I coded a simple strategy where I buy limit below the market.
What I don't understand is why, once filled the two orders, the strategy creates a new position (at the market). I tried with TraceOrders, but I don't understand.
below the code:
protected override void Initialize()
{
CalculateOnBarClose = true;
EntriesPerDirection = 1;
EntryHandling = EntryHandling.UniqueEntries;
TimeInForce = Cbi.TimeInForce.Day;
TraceOrders = true;
SetProfitTarget("Buy_Test", CalculationMode.Ticks, 5);
SetProfitTarget("Buy_Test1", CalculationMode.Ticks, 5);
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
if (start_Price > 1)
{
EnterLongLimit(nCtr, 1207, "Buy_Test");
EnterLongLimit(nCtr, 1206, "Buy_Test1");
}
}
Thanks.

Comment