Duplicate: Multiple System Backtest


#1

I am trying to backtest a combination of two systems. System #1 uses PositionScore to buy two stock ETFs with the highest recent ROC and then holds for 5 days. System #2 is just a buy and hold of a bond ETF. I am using 3 watchlists, i.e. a watchlist of stock ETFs for System #1, a different watchlist for the bond ETF for System #2, and a combined watchlist of the stock & bond ETFs to select as the filter for the backtest. My code is below. My problem is that the backtest only provides results for System #1. The buy and hold position from System #2 is not included. Any suggestions would be much appreciated!

SetOption( "InitialEquity", 100000 );  
   
BuyPrice = Close;   
SellPrice = Close;   

Rate = ROC(C,21);

if( InWatchList(26) )  // System 1
{
SetOption("MaxOpenPositions",2);
SetPositionSize( 10000, spsValue); 

Buy = Rate>0;
Sell = 0; 
ApplyStop( stopTypeNBar, stopModeBars, 5 );   

PositionScore = Rate; 
}

if( InWatchList(27) )  // System 2
{
SetOption("MaxOpenPositions",1);
SetPositionSize( 10000, spsValue);

Buy = 1;
Sell = 0;
}

#2

Use the search. Such threads already exist: Backtesting Two (or more) Strategies Simultaneously and
Backtesting multiple systems with different parameters and Different exits

Don't create duplicate topics.


#3

#4