I created a method to calculate a range. The value of this range is used to calculate the Exit.
The problem is that the value of the Range does not remain stationary, but varies with each candle. How can I do to make it stay fixed?
Example:
# Region OrderRouting //Region to manage the position Long
private void ManagerOrder ()
if (Position.MarketPosition == MarketPosition.Long)
{
if ( High [0]> Position.AvgPrice + RangeLong () ) the value of the Range is not that calculated when EnterLong, changes each candle
}
private double RangeLong () //method to calculate the Range
return (MAX (HIGH, 5) [0]-MIN (Low, 10) [5]);
protected override void OnBarUpdate ()
RangeLong ();
if (Low [0] <MAX (High, 5) [0] - RangeLong ())
EnterLong
If, instead, I try to do this:
RangeLong () = VariableM
the value of variableM becomes equal to the value of the Range, remains as the initial default (1).
How can I do?
Thanks.
Hello.
Roberto
Comment