Hi everyone,
I’m not an ATR specialist, how do I calculate if my candle is X times bigger than the average of the last 10 , I tryed this code but I get an error,
The idea is to detect an abnormally large candle
//MyATR = TR(Close)
//MyATRAverage = Average(10)[MyATR]
//Return MyATR AS "MyATR", MyATRAverage AS "ATR Average"
MyRange = High - Low
MyRangeAverage = Average(20)[MyRange]
Return MyRange AS "MyRange", MyRangeAverage AS "MyRangeAverage"
Best Reguards,
ZeroCafeine
Good morning,
You have swapped parentheses and brackets in your average, try instead:
MyRangeAverage = average[20](MyRange)
On a side note, keyword “range” is already high-low, you don’t need to create it with “myrange”
By the way, in the wake of yesterday’s “tip”, another tip to avoid such parentheses issues and save you time not having to find the problem and solve it: typing the start of the keyword (for example “aver” for average), and clicking in toolbar on the yellow lightbulb, it will propose all language keywords with “aver” inside, then click on the one wanted in the list and it will complete “aver” in your code, in this case “average[20](close)”, now that syntaxt is ok, replace 20 if needed, replace close if needed.