Hello everyone,
I am testing a monthly rotational strategy with the following code:
SetBacktestMode(Backtestrotational);
SetOption("initialequity", 100000);
SetOption("Maxopenpositions",4);
SetPositionSize( 25, spsPercentOfEquity );
Score= ((ROC(Close, 8) + ROC(Close, 10)) + ROC(Close, 12))/ 3 ;
Positionscore= Score+1000;
BuyPrice= Close;
ApplyStop(stopTypeTrailing,stopModePercent, Optimize("stoploss", 10,1,30,1));
I want to add a stop loss but I am concerned since I am using monthly bars during the test that the stop loss will not be accurate . The trailing stop loss would need to be updated daily while the test is using monthly bars. I did some research on time frame expand function but I was not able to figure out how to program that into the stop loss. Thank you again for any help/ feedback you can give!