i would like to code ema percentages if possible or something similar. eg when say 5,10,20,50ema are all within a percentage of each other. Any ideas on how to do this?
You can write:
Avg1 = average[5](close)
Avg2 = average[10](close)
Avg3 = average[20](close)
c1 = Avg1 > (Avg2 * 1.01) AND Avg2 > (Avg3 * 1.01)
IF c1 THEN...
This will set C1 when each MA is higher THAN the slower one by 1%, you can use 1.001 for 0.1% and so on.
To check when they’re lower you need to write 0.99 for -1% or 0.999 for -0.1% and so on.