I trade the ES market.
I am building a strategy manually through ninjascript. The strategy only operates between the hours of 8:30:05 AM and 12:00PM. I would like to know how to have the strategy enter either long or short every, say 15 minutes, within that timeframe?
below is a portion of of the script:
Dataseries: ...Minute, 15);
if ((ToTime(Time[0]) >= startTime && ToTime(Time[0]) < endTime))
{
if (Close[0] > Open[0])
EnterShortStopMarket(0,true,Convert.ToInt32(OrderQ uantity), ShortEntryPrice, "ShortEntryPrice");
}
The strategy enters fine the first time; however, on its second time, I receive an error that reads "short stop order cannot be placed above market price".
In this back test scenario, the historical market price on second entry is higher than the market price on the first entry.
Thanks in advance.
Comment