I made a script for finding equal lows on the DAX. I look for differences of 0, 0.5 and 1 points, because the price sometimes deviates slightly.
Now I have made the script below, so that a line is placed on the graph. The problem is that the script can’t handle searching for 0, 0.5 and 1 simultaneously. I’ve used the function with OR and it doesn’t seem to work. I can of course put the formula in the script again to create three conditions, but it seems to me that there is a smarter way to do it.
If I enter 1 value in Af1 it works perfectly, but with multiple values using the OR function it doesn’t work.
Who knows how I can cleverly include this in the script with Af1= 0 OR 0.5 OR 1. What am I overlooking? 🙂
//DAX same lows
//26-11-22
Af1 = 0 OR 0.5 OF 1
//Same lows
for p = 4 to 100 do
if ABS(low[1] – low[p]) = Af1 THEN
x1 = barindex[1]
y1 = low[1]
x2 = barindex[p]
y2 = low[p]
endif
next
DRAWSEGMENT (x1,y1,x2,y2)coloured(255,10,10)
RETURN