I would like to code a strategy with two positions in one direction with two different conditions.
protected override void Initialize ()
{
EntriesPerDirection = 2;
EntryHandling = Entryhandling.AllEntries;
CalculateOnBarClose = true;
}
protected override void OnBarUpdate ()
{
if (Position.MarketPosition == MarketPosition.Flat && Condition1)
{
EnterLong(DefaultQuantity, "Long1";
}
if (Position.MarketPosition == MarketPosition.Long && Condition2)
{
EnterLong(DefaultQuantity, "Long2";
}
If (Condition Exit)
{
ExitLong("","");
}
But it is not working. I don´t get an execution for Long2?
Thank you.
Comment