|
Kiran
2015-05-10 20:24:07
0
|
|
Actually, following are the 2 systems (ignore the ones above as they dont have the SetSimTiming commands.
-> Also noticed that the Sell orders in B) are not executing at the correct SellPrice, but at Open, ad sometimes when the bar doesnt even touch the Stop price of Llv(low,2)-0.1*atr(10). Is this a bug? How do i fix this in the Tomorrow system, so that i have the formula-based Sell executing at a Stop price?
// A) Execute today ..
SetSimTiming(_Buy,_Stop,-1);
BuyPrice(ref(Hhv(high,2),1)+0.1*atr(10), 1);
buy=1;
SetSimTiming(_Sell,_Stop,-1);
SellPrice(ref(Llv(low,2),1)-0.1*atr(10), 1);
sell=1;
SetSimStop(_StopLoss, _Point, 0.1*atr(10), 1);
//B) Execute tomorrow ..
SetSimTiming(_Buy,_Stop,0);
BuyPrice(Hhv(high,2)+0.1*atr(10),1);
buy=1;
Optimize("sellPer", 2, 4, 1);
SetSimTiming(_Sell,_Stop,0);
SellPrice(Llv(low,2)-0.1*atr(10), 1);
sell=1;
SetSimStop(_StopLoss, _Point, 0.1*atr(10), 1);
|
|