|
Kiran
2016-12-06 18:54:56
|
|
I'm running a daily simulation and want to simulate buying at the mid-point of Open and Close, so i tried the following code, but it doesn't generate any trades.
Pl advise how to fix this script? If StopLimit doesn't work with specific price, is there some other way to trigger orders at this price point in Quantscript?
Buy = <condition>;
SetSimTiming(_Buy,_StopLimit,0);
midP = (ref(open,-1)+ref(close,-1))/2;
BuyPrice(midP,1);
I realize that placing an order at mid-point of Open & Close is peeking ahead, but i just want to compare approximate performance of placing orders middle-of-day vs at Close.
thanks
Kiran
|
|