I've noted an issue or misunderstanding how limit orders should work.
I'm trying to send multiple limit orders to market on a certain condition, example below:
else if (State == State.Configure)
{
SetProfitTarget("", CalculationMode.Percent, 0,01);
SetStopLoss("", CalculationMode.Percent, 0,01, false);
}
protected override void OnBarUpdate()
{
if (CurrentBars[0] < 1)
return;
}
if (Close[0] > Close[1]))
{
EnterLong(Convert.ToInt32(DefaultQuantity), @"LongEntry");
EnterLongLimit(Convert.ToInt32(DefaultQuantity), (Close[0] + (-10 * (TickSize * 10))) , @"LongLimit1");
EnterLongLimit(Convert.ToInt32(DefaultQuantity), (Close[0] + (-20 * (TickSize * 10))) , @"LongLimit2");
}
What will happen in backtester, is that the limit orders only get filled on current bar and seems to get removed after current bar is complete. Should it work like this? If yes, is it very complicated to get the limit orders staying active after bar complete? Or do I need to change the way the stop and profit is handled for this to work?
br,
Chris
Comment