♥ 0 |
are we allowed to add message bar and audio ring alerts to watch lists on TOS? i tried doing it but it seems i got it all wrong. i also tied added alerts to subgraph TTM squeeze and it turned the subgraph into a yes or no spike indicator but the audio and message bar does alert properly. just indicator just doesnt display like the original TTM squeeze indicator. code for watchlist: input price = CLOSE; def squeezeHistogram = TTM_Squeeze(price, length, nK, nBB, alertLine).Histogram; plot hist = if squeezeHistogram>= 0 then assignBackgroundColor(if squeezeHistogram >= 0 then hist.assignvaluecolor(if squeezeHistogram >= 0 then declare lower; #input price = CLOSE; #def sqzHist = TTM_Squeeze(price, length, nK, nBB, alertLine).Histogram; def cyanToBlue = sqzHist > 0 and sqzHist < sqzHist[1] and sqzHist[1] > sqzHist[2]; def redToYellow = sqzHist <= 0 and sqzHist > sqzHist[1] and sqzHist[1] < sqzHist[2]; Alert(cyanToBlue, “TTM Squeeze Blue Bar”, Alert.BAR, Sound.Ring); code from TTM squeeze subgraph:# Source code isn’t available. declare lower; input price = CLOSE; plot Histogram = Double.NaN; def sqzHist = TTM_Squeeze(price, length, nK, nBB, alertLine).Histogram; def cyanToBlue = sqzHist > 0 and sqzHist < sqzHist[1] and sqzHist[1] > sqzHist[2]; plot redToYellow = sqzHist <= 0 and sqzHist > sqzHist[1] and sqzHist[1] < sqzHist[2];
Marked as spam
|
Private answer
Keep working at it, you are learning through trial and error. Each piece of knowledge lays the foundation for the next level. In answer to your first and original question. It is not possible to add alerts to a watchlist column. You can add the lines of code but they are never active. In answer to your second post, asking about adding alerts to a lower study. You say the lower study is not matching the indicator. This is because the conditions you have assembled are incorrect. We have already published code that indicates the change in color of the TTM Squeeze histogram: https://www.hahn-tech.com/thinkorswim-ttm-squeeze-watchlist/ In that video, we did this for a custom watchlist column. The code can be easily adapted to plot in a lower study. Once you get that working, your alert statements should work. Hope it helps. Marked as spam
|
Please log in to post questions.