Hi..
I’ve got a theory, any preloaded bars in a strategy my give a valid ATR value for the logic.
In indicator, it needs 200 bars before valid ATR value available, since starting at bar zero.
This might have found a never ‘true’ condition in the logic so no output.
If you move the ‘ENDIF’ keyword, for the ‘BARINDEX>200 ‘IF’ block, to the end of the code just before ‘RETURN’, then something happens!
Not sure if this ‘something’ is the desired outcome.
Seems strange to use ‘ATR’ later in the code run but it may be ‘UNDEFIND’ till 200 bars up.
Moving this ‘ENDIF’ means all code inside new code block waits till valid ‘ATR’ value before executing.
Regards druby
1 user thanked author for this post.