♥ 0 |
Hi Pete, if it’s not too much to ask, can you create two custom scans that i will plan to use as mobile alert on my watchlists? #1 if the current price breaks out at least above 0.05% from the recent UpFractal pivot high price #2 if the current price breaks out at least below 0.05% from the recent DownFractal pivot low price I’ve converted WilliamsFractal pattern into a chart study already below. I thought about customizing this code using “within 10-20 bars ago” but i figured it would not work if pivot points are too close with each other, and using less bars ago may not detect it. Plus i get a warning for having too complex of a script. Is there a simpler way to do this? I’ve attached a picture to help me with my questions. Thanks again in advance, Pete.
declare lower; input sequenceCount = 6;
def maxSideLength = sequenceCount + 10; def upRightSide = fold i1 = 1 to maxSideLength + 1 with count1 while count1 != sequenceCount and count1 != -1 do if GetValue(high, -i1, -maxSideLength) > high or (GetValue(high, -i1, -maxSideLength) == high and count1 == 0) then -1 else if GetValue(high, -i1, -maxSideLength) < high then count1 + 1 else count1; def upLeftSide = fold i2 = 1 to maxSideLength + 1 with count2 while count2 != sequenceCount and count2 != -1 do if GetValue(high, i2, maxSideLength) > high or (GetValue(high, i2, maxSideLength) == high and count2 >= 1) then -1 else if GetValue(high, i2, maxSideLength) < high then count2 + 1 else count2;
def downRightSide = fold i3 = 1 to maxSideLength + 1 with count3 while count3 != sequenceCount and count3 != -1 do if GetValue(low, -i3, -maxSideLength) < low or (GetValue(low, -i3, -maxSideLength) == low and count3 == 0) then -1 else if GetValue(high, -i3, -maxSideLength) > low then count3 + 1 else count3; def downLeftSide = fold i4 = 1 to maxSideLength + 1 with count4 while count4 != sequenceCount and count4 != -1 do if GetValue(low, i4, maxSideLength) < low or (GetValue(low, i4, maxSideLength) == low and count4 >= 1) then -1 else if GetValue(low, i4, maxSideLength) > low then count4 + 1 else count4;
def UpFractal = upRightSide == sequenceCount and upLeftSide == sequenceCount; def DownFractal = downRightSide == sequenceCount and downLeftSide == sequenceCount;
plot scan = UpFractal; plot scan2 = downfractal;
Marked as spam
|
Please log in to post questions.