for the pourpose to train on asset WDO$D and trade on asset WDOK18, would does this work??

asset("WDO$D");
vars PriceCloseWDO = series(priceClose());
Parameter = optimize(...);
var Signals[2];
Signals0 = signal generation based on Parameter and PriceCloseWDO ...
Signals1 = signal generation based on Parameter and PriceCloseWDO ...
bool BuySig = adviseLong(DTREE,0,Signals,2) > 0;
bool SellSig = adviseShort(DTREE,0,Signals,2) > 0;

if(is(TRADEMODE)) asset("WDOK18");
if(BuySig) enterLong();
if(SellSig) exitLong();

Last edited by jmlocatelli; 04/12/18 18:47.