Hi,
ThinkOrSwim has a candlestick pattern called ZigZagStepPattern. It would be nice to have sound alerts. I copied the source of this and created a study of it. Then I added lines for the alerts but they do not execute. I have also added vertical lines and they show up on the chart just fine.
Does anyone know why sound alerts don't work (for me)?
Thank you.
Jim
ThinkOrSwim has a candlestick pattern called ZigZagStepPattern. It would be nice to have sound alerts. I copied the source of this and created a study of it. Then I added lines for the alerts but they do not execute. I have also added vertical lines and they show up on the chart just fine.
Does anyone know why sound alerts don't work (for me)?
Thank you.
Jim
Code:
#
# TD Ameritrade IP Company, Inc. (c) 2013-2020
#
# Added alerts (if they work)
input priceH = high;
input priceL = low;
input percentageReversal = 5.0;
input absoluteReversal = 0.0;
input atrLength = 5;
input atrReversal = 1.5;
def zigZag = reference ZigZagHighLow(priceH, priceL, percentageReversal, absoluteReversal, atrLength, atrReversal).ZZ;
def step1 = open[1] >= open and open >= close[1] and open[1] > close[1];
def step2 = open[1] <= open and open <= close[1] and open[1] < close[1];
def upStep1 = step1 and close > open[1];
def upStep2 = step2 and close > close[1];
def downStep1 = step1 and close < close[1];
def downStep2 = step2 and close < open[1];
plot UpStep = (upStep1 or upStep1[-1] or upStep2 or upStep2[-1]) and zigZag == low;
plot DownStep = (downStep1 or downStep1[-1] or downStep2 or downStep2[-1]) and zigZag == high;
UpStep.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
UpStep.SetDefaultColor(GetColor(0));
UpStep.SetLineWeight(2);
Alert(UpStep, "ZigZag Long", Alert.BAR, Sound.Ding);
AddVerticalLine (UpStep, " ZigZag Long", Color.GREEN);
AddLabel(UpStep, "ZigZag Long", Color.GREEN);
DownStep.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
DownStep.SetDefaultColor(GetColor(1));
DownStep.SetLineWeight(2);
Alert(DownStep, "ZigZag Short", Alert.BAR, Sound.Ding);
AddVerticalLine (DownStep, " ZigZag Short", Color.RED);
AddLabel(DownStep, "ZigZag Short", Color.RED);