If you could, please tell me why what I did was wrong. This is all I've written in the script editor:
protected override void OnBarUpdate()
{
if (Close[2] < Close[3]) && (Close[3] < Close[4]) && (Close[1] > Close[2]) && (Position.MarketPositon.Flat = true);
{
EnterLong();
}
if (Position.MarketPostion.Long = true) && (Close[1] < Close[2]);
{
ExitLong();
}
if (Close[2] > Close[3]) && (Close[3] > Close[4]) && (Close[1] < Close[2]) && (Position.MarketPositon.Flat = true);
{
EnterShort();
}
if (Position.MarketPosition.Short = true) && (Close[1] > Close[2]);
{
ExitShort();
}
return;
}
The black boxes indicate what the strategy should recognize as a signal to enter/exit.

Also here are my errors:

Comment