The variables double myRangeLong and double my RangeShort, are used to determine the Exit. The Long part works fine, while the Short, opens and closes the position on the same bar. If, however, use only the Short is okay. I tried to create for the operation Short, callOnce2 but does not work.
Ciao
Roberto
Code:
# region OrderRouting
private void ManagerOrder ()
{
if (Position.MarketPosition == MarketPosition.Long callOnce & &)
double myRangeLong = (MAX (HIGH, 5) [0]-MIN (Low, 10) [5]);
callOnce = false;
}
{
if (BE1 & & High [0]> (Position.AvgPrice +5)
SetStopLoss (CalculationMode.Price, Position.AvgPrice);
if (Position.MarketPosition == MarketPosition.Short callOnce & &)
double myRangeShort = ((MIN (Low, 5) [0] - MAX (H, 10) [5]) *- 1);
callOnce = false;
protected override void OnBarUpdate ()
if (Position.MarketPosition == MarketPosition.Flat)
callOnce = true;
ManagerOrder ();
if (Position.MarketPosition! = MarketPosition.Flat) return;
/ / Long
Etc. ....
/ / Short
Etc. ...
Comment