Hi all,

I have the script below, but after Train I execute the Test but the script crash. Why?
Where is the error?

I want to try the Train with 1 broker and Test with others broker to test the strength of the strategy.
The BarPeriod is 1440, the result should be the same regardless of the broker.

Code:
void run()
{
  StartDate = 2010;
  EndDate = 2017;
  BarPeriod = 1440;
  LookBack = 150;
  TradesPerBar = 2;
  WFOCycle = 2;
  if(Train) Hedge = 2;
  set(RULES|TESTNOW);
  
// generate price series
  vars H = series(priceHigh()), 
    L = series(priceLow()),
    C = series(priceClose());


// generate some signals from H,L,C in the -100..100 range
  var Signals[2]; 
  Signals[0] = (LowPass(H,1000)-LowPass(L,1000))/PIP;
  Signals[1] = 100*FisherN(C,100);

  
// train and trade the signals 
  Stop = 4*ATR(100); 
  TakeProfit = 4*ATR(100);
  if(adviseLong(DTREE,0,Signals,2) > 0)
    enterLong();
  if(adviseShort(DTREE,0,Signals,2) > 0)
    enterShort();
}



thanks in advance

Last edited by tradingest; 04/29/18 08:19.