Indicator code:
protected override void OnBarUpdate()
{
if (FirstTickOfBar)
{
Coded Logic
//Trying to enter an UP trade
if (X=Y) //redundant
if (X=Y)
if (X=Y)
if ((X=Y) | (X=Y))
{
upentry = true; //for the indicator
EnterLong(); //for the strategy
}
}
}
If the indicator calls the trade, say, on the first tick of bar 100, the strategy enters the trade on the first tick of bar 101. If it makes a difference, I'm using 15 minute candles.
The is a lot of logic based on bar number like this:
if ((Close[1] - Open[1]) < 0.0)
{lastred = true;}
else
{lastred = false;}
volatility = (High[2] + High[3] + High[4] - Low[2] - Low[3] - Low[4])/3.0;
Can anyone tell me what to do? This variance makes a hugh difference as one might suspect.
Thanks!


Comment