My primary bar data is daily and I've added
Add(PeriodType.Week, 1); into the initialize() function area. I've also got an exit strategy set up just to get some readings.
My script is this:
protectedoverridevoid OnBarUpdate()
{
if (BarsInProgress == 0)
{
if (CrossAbove(ADX(BarsArray[0], 14), 17, 1)&& ADX(BarsArray[1], 14)[0] > 17)
{
EnterLong(1000, "Enter Order1");
}
}
if (BarsInProgress == 0)
{
if (CrossBelow(ADX(BarsArray[0], 14), 17, 1))
{
ExitLong("Exit Order1","");
}
}
}
But I still get orders made even when the ADX(14) of the weekly bar (BarsArray[1]) is less than 17.
Can someone tell me where I'm going wrong.
Comment