Here is the Log message. Need help to understand this log message also. My intension is to Update the Limit price if it goes higher than the current limit else keep the same limit exit order.
Specifically I need help with this part.
if ( Position.MarketPosition == MarketPosition.Long)
{
EnterLongLimit(Convert.ToInt32(DefaultQuantity), (EMA3[0] + ((ATR1[0] * Multiplier) )) , @"APBull");
}
if ( Position.MarketPosition == MarketPosition.Short)
{
EnterShortLimit(Convert.ToInt32(DefaultQuantity), (EMA3[0] - ((ATR1[0] * Multiplier) )) , @"APBear");
}
protected override void OnBarUpdate()
{
if (CurrentBars[0] < BarsRequiredToTrade)
{
return;
}
if (BarsInProgress != 0)
return;
if (CurrentBars[0] < 1)
return;
// Set 1
if (LONGENTRYCONDITION)
{
Print("Entering Long Position @" + GetCurrentAsk(0));
EnterLong(Convert.ToInt32(DefaultQuantity), @"APBull");
}
if ( Position.MarketPosition == MarketPosition.Long)
{
EnterLongLimit(Convert.ToInt32(DefaultQuantity), (EMA3[0] + ((ATR1[0] * Multiplier) )) , @"APBull");
}
if ( Position.MarketPosition == MarketPosition.Short)
{
EnterShortLimit(Convert.ToInt32(DefaultQuantity), (EMA3[0] - ((ATR1[0] * Multiplier) )) , @"APBear");
}
// Set 2
if (SHORTENTRYCONDITION)
{
Print("Entering Short Position @" + GetCurrentAsk(0));
EnterShort(Convert.ToInt32(DefaultQuantity), @"APBear");
}
}

Comment