Profile Picture

Bug in StopLossType and ProfitTargetType

Posted By eong9 8 Years Ago
Message
Posted Sunday August 30 2009
In the following code, the TargetPriceType for StopLossType and ProfitTargetType are returning as "Percentage" even though it is explicitly set to "None". The correct behavior is observed only if settings.StopLoss or settings.TargetPrice is assigned a value.

public override void NewBar()
   {
      if (Close.Current < Open.Current)      
      {      
         PositionSettings settings = new PositionSettings();
         settings.PositionType = PositionType.Long;         
         settings.OrderType = OrderType.Market;         
         settings.ProfitTargetType = TargetPriceType.None;
         settings.StopLossType = TargetPriceType.None;
         
         Position position = OpenPosition(settings);
         Console.WriteLine("position.ProfitTargetType = "+position.ProfitTargetType);
         Console.WriteLine("position.StopLossType = "+position.StopLossType);
      }
   }
Posted Monday August 31 2009
This will be corrected in the next build.


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems