simple crash code

Posted By: Grat

simple crash code - 06/22/19 12:12

Hi,

which is a wrong in this code?
Code
void run(){
  
  StartDate 	= 20190210;
  EndDate     = 2019;
  BarPeriod 	= 15;

  LookBack    = 200;
  Capital     = 10000;

  Stop = 10*ATRS(100);
  TakeProfit =4*ATRS(76) ;
  assetList("History\\AssetsGP.csv");
  asset("EUR/USD");

  NumYears = 1;
  Hedge = 2;          // allow long + short
  LifeTime = 20;      // = prediction horizon
  OrderDelay = 60;
  set(TICKS);  
  set(STEPWISE);
  enterLong(1);
}


afer click on the test, zorro crash without any warning
Posted By: Spirit

Re: simple crash code - 06/22/19 12:59

https://manual.zorro-project.com/asset.htm

Setting TICKS when the asset was already loaded, is no good idea, the ticks were not created and it will crash.
Posted By: Grat

Re: simple crash code - 06/22/19 18:37

you have true, thanks
© 2024 lite-C Forums