♥ 0 |
Hey I’m trying to set an alert when WilliamFractal up is true. Using this script in thinkscript “WilliamsFractal(“sequence count” = 2).DownFractal is true”. When setting up the alert it shows that everything works fine like it should. However when the alert is active it doesn’t trigger, even when I watch the WilliamFractal up is true. I even added a within 2 bars, it still don’t work
Marked as spam
|
I cannot help you unless you provide the actual code for the “WilliamFractal”. As stated in my answer, this study does not exist in Thinkorswim. So I don’t even have the code.
yes, here is the code, but its a pattern and I have set alerts on other patterns when they are true, I can’t seem to figure out why this one won’t work.
input sequenceCount = 2;
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) > high or (GetValue(high, -i1) == high and count1 == 0) then -1
else if GetValue(high, -i1) < 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) > high or (GetValue(high, i2) == high and count2 >= 1) then -1
else if GetValue(high, i2) < 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) < low or (GetValue(low, -i3) == low and count3 == 0) then -1 else if GetValue(high, -i3) > 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) < low or (GetValue(low, i4) == low and count4 >= 1) then -1
else if GetValue(low, i4) > low then count4 + 1 else count4;
plot UpFractal = if upRightSide == sequenceCount and upLeftSide == sequenceCount then high else Double.NaN;
plot DownFractal = if downRightSide == sequenceCount and downLeftSide == sequenceCount then low else Double.NaN;
UpFractal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_WEDGE_UP);
UpFractal.SetDefaultColor(GetColor(3));
UpFractal.SetLineWeight(2);
DownFractal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_WEDGE_DOWN);
DownFractal.SetDefaultColor(GetColor(4));
DownFractal.SetLineWeight(2);
I can’t get this full code to work either. Sorry, I don’t have a solution for you.
Thank you for the try! Glad to know I wasn’t the only one.