Stock price greater than and smaller than
Author: mrsic
Creation Date: 7/11/2018 9:05 AM
profile picture

mrsic

#1
Hi,
i am not a programmer but i give my best.

Can anyone help me with this. I want testing a portfilio with Stocks between 10$ und 100$ and i dont know how. I have try it with "SetShareSize" - i think this is wrong because it's a method.

CODE:
Please log in to see this code.


greetings Damir
profile picture

Eugene

#2
Hi Damir,

It's
CODE:
Please log in to see this code.


However, note that your backtesting results can be inaccurate when using the fixed price boundaries due to split adjustment. The correct way to do it can be found in post #2 in thread below, for example:

Split and Dividend Adjusted Prices? (Custom cumulative dividend series)

As you can see in the walkthrough, it's a very simple change to your trading system. Since you're not dealing with Fidelity data, a little tweak is required to the code example:

CODE:
Please log in to see this code.


Other providers (e.g. Google) may not support this.
profile picture

mrsic

#3
Hi Eugene,

QUOTE:
//Replace this...
//DataSeriesOp.SplitReverseFactor( this, "split", out reverseAdjustment);

//...with this for Yahoo, W-D or other providers:
DataSeriesOp.SplitReverseFactor( this, "Split (Yahoo! Finance)", out reverseAdjustment);
DataSeriesOp.SplitReverseFactor( this, "Split (Wealth-Data)", out reverseAdjustment);
DataSeriesOp.SplitReverseFactor( this, "Split (Quandl)", out reverseAdjustment);
DataSeriesOp.SplitReverseFactor( this, "Split (Tiingo)", out reverseAdjustment);

Is this not the same as in WL - Data Manager - Yahoo Data! - checkmark "Perform Split Adjustment"?
Or do i need this because i am using the settings in the DataManager?
profile picture

Eugene

#4
Yes, you can disable split adjustment for Y! Provider and then your backtest will operate with the unadjusted historical prices - as they were in stock's history. In this case the SplitReverseFactor trick isn't required.
profile picture

mrsic

#5
Thanks Eugene.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).