I'm trying to build a strategy based on SMA cross over. For calculations I'm using OnBarClose. I read from a previous post that you would use (Close[0] > Close[1])).
I tried using the condition but still, an order still gets placed and filled.
This is my condition for entry:
---------------------
protected override void OnBarUpdate()
{
if (BarsInProgress != 0)
return;
if (CurrentBars[0] < 1)
return;
// Set 1
if ((CrossAbove(SMA1, SMA2, 1))
&& (Close[0] > Bollinger1.Middle[0])
&& (CurrentBars[0] != SavedBar)
&& (Position.MarketPosition == MarketPosition.Flat)
&& (Close[0] > Close[1]))
{
EnterLong(Convert.ToInt32(DefaultQuantity), goldenentry);
SavedBar = Convert.ToInt32(CurrentBars[0]);
}
--------------------------------------
Attached is the snapshot of the entry...
Possible to add some guidance where to look?

Comment