IsInstantiatedOnEachOptimizationIteration = true;
TakeProfit = 8;
Stoploss = 16;
}
else if (State == State.Configure)
{
}
else if (State == State.DataLoaded)
{
EMA1 = EMA(Close, 21);
EMA2 = EMA(Close, 50);
EMA1.Plots[0].Brush = Brushes.Yellow;
EMA2.Plots[0].Brush = Brushes.Lime;
AddChartIndicator(EMA1);
AddChartIndicator(EMA2);
SetProfitTarget(@"EMAshort", CalculationMode.Ticks, TakeProfit);
SetStopLoss(@"EMAShort", CalculationMode.Ticks, Stoploss, false);
}
else if(State==State.Historical)
{
load buttons
}
OnBarUpdate()
if (Realtime)
{
if(CurrentBar>1)
{
if(Position.MarketPosition=MarketPosition.Flat)
{
currentpos= 1
}
}
}
.
Comment