Candle ID for ATR indicator
-
Hello! Can someone enlighten me in this -I have an EA which will enter a trade upon the start of a new candle based on ATR. Is my understanding correct that-
-
if the candle ID for my ATR indicator is 1 (previous candle), the EA will refer to the ATR value of the previous closed candle?
-
if the candle ID for my ATR indicator is blank (0 by default, means current candle), the EA will refer to the ATR value of the current forming candle?
-
if point 2) is true, since my EA only opens once per bar at each start of a new candle (and never in the middle of a forming candle), this means that the ATR value referred to in point 2) will be the one at the very point when the new candle just formed?
Many thanks in advance!
-
-
@tanjiayi1 Here in short ...
- right
- also right, but as you are at the very begining of the candle, the result is wrong. If you have a period of let's say 14 it can make a slight difference especially on a daily chart. If you use period 200 or something like that, it won't matter that much. But by principle you should work with closed candles - meaning candle ID1.
- Well, I think I answered that in 2 already, but from calculation perspective assuming your ATR period is 14, using candle ID0 means calculation of 13 full candles and 1 with almost no move when you EA opens the trade or checks the condition.
-
wow got it, thanks so much for the detailed explanation, this really helps!!