I have this code
protected override void Initialize()
{
//SetStopLoss("", CalculationMode.Ticks, 10, false);
CalculateOnBarClose = true;
Add(PeriodType.Minute, 1);
Add(SMA(200));
Add(EMA(9));
Add(EMA(26));
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Condition set LONG
if (Close[0] > SMA(200)[0]
&& CrossAbove(EMA(9), EMA(26), 1))
{
DrawArrowUp(CurrentBar.ToString(), true, 0, Low[0] - TickSize, Color.Green);
Print("LONG"+DateTime.Now);
}
// Condition set SHORT
else if (Close[0] < SMA(200)[0]
&& CrossBelow(EMA(9), EMA(26), 1))
{
DrawArrowDown(CurrentBar.ToString(), true, 0, High[0] + TickSize, Color.Red);
Print("SHORT"+DateTime.Now);
}
}
I do not know what I can be doing wrong!
Thank you for help !!

Comment