I've got a problem. A part of my current code looks like this:
if (ToTime(Time[0]) >= ToTime(17, 05, 0)
&& ToTime(Time[0]) < ToTime(22, 15, 0)
&& Close[X] > Open[X]
&& Close[X] - Open[X] > 1
&& Position.MarketPosition != MarketPosition.Short
&& ToTime(Time[0]) % 500 == 0)
{
EnterShortLimit(DefaultQuantity, X, "");
SetProfitTarget(CalculationMode.Price,plus());
}
Now I have observed, that - if the order haven't got filled until the open of the next 10 seconds bar - the order gets cancelled.
Now I wanted to ask, how it is possible, to maintain the order. My aim is, that every 5 minutes, there shall be a limit order, which stays until the next 5 minutes have begun. Can you follow me? So the order should get filled anywhen between these 5 minutes, but with the parameters set at the beginning of the 5 minutes - I hope you know what I mean.
If necessary: I've set on "Calculate on bar close = true" during realtime simulation. Perhaps this has something to do with it.
Best Regards,
Sepp
Comment