I have a strategy study (Long only) entry with 2 contracts, then when it reaches a level set to: Position.AvgPrice + ATR (14) [0], sells 1 contract and held the second with a stop located: Position.AvgPrice - Low [2] - (ATR (14) [0] * 0.3 * TickSize.
the code I wrote:
#region OrderRouting
private void MenagerOrder()
{
if (Position.MarketPosition == MarketPosition.Long)
{
if( High[0]> Position.AvgPrice + ATR (14)[0])
ExitLong(1, "1° Target LongBuy", "");
SetStopLoss("LongBuy",CalculationMode.Price,Positi on.AvgPrice - Low[2] - (ATR(14)[0] * 0.3* TickSize), true);
#endregion
protected override void OnBarUpdate()
MenagerOrder();
etc.....
my problem is that, after reaching the 1st Target does not SetStopLoss
Why?
Ciao
Italy
Comment