Hi All, Thank you for the effort.
1. How can I replace the chartBubble with UPARROW and DOWNARROW?
def buySignal = direction == 1 and direction[1] == -1;
#AddChartBubble(buySignal and ShowLabels, low, "Buy Signal", Color.Green, no);
Tried simply
plot buySignal; # did not work
Tried the below did not work.
def bS1;
plot bS1 = if direction == 1 and direction[1] == -1 and ShowLabels == yes then ??
2. How do I use this code for scanning?
#Chandelier Exit (Upper Study)
#Version 1.0 Released 04/10/22
#Created by CustomThinkscript
input ATRLength = 22;
input ATRMultiplier = 3;
input ShowLabels = yes;
input UseClose = yes;
input HighlightState = yes;
input Alerts = no;
def atr = ATRMultiplier * ATR(ATRLength);
def longStop = (if UseClose then highest(close, ATRLength) else highest(high, ATRLength)) - atr;
def longStopPrev = if IsNan(LongStop[1]) then longStop else LongStop[1];
def LS =if close[1] > longStopPrev then max(longStop, longStopPrev) else longStop;
def shortStop = (if UseClose then lowest(close, ATRLength) else lowest(low, ATRLength)) + atr;
def shortStopPrev = if IsNan(shortStop[1]) then shortStop else shortStop[1];
def SS =if close[1] < shortStopPrev then min(shortStop, shortStopPrev) else shortStop;
def dir = if close > shortStopPrev then 1 else if close < longStopPrev then -1 else dir[1];
def direction = dir;
plot LongStopPlot = if direction == 1 then LS else double.Nan;
longStopPlot.SetDefaultColor(Color.Green);
plot ShortStopPlot = if direction == -1 then SS else Double.Nan;
shortStopPlot.SetDefaultColor(Color.Red);
def midPricePlot = OHLC4;
def buySignal = direction == 1 and direction[1] == -1;
def sellSignal = direction == -1 and direction[1] == 1;
AddChartBubble(buySignal and ShowLabels, low, "Buy Signal", Color.Green, no);
AddChartBubble(sellSignal and ShowLabels, high, "Sell Signal", Color.Red, yes);
AddCloud(if direction == 1 and HighlightState then longStopPlot else Double.Nan, If direction == 1 and HighlightState then midPricePlot else Double.Nan, Color.Green, Color.Green, no);
AddCloud(if direction == -1 and HighlightState then shortStopPlot else Double.Nan, If direction == -1 and HighlightState then midPricePlot else Double.Nan, Color.Red, Color.Red, no);
Alert(direction == 1 and direction[1] == -1 and Alerts, "'Chandelier Exit' Buy!", Alert.ONCE, Sound.Ding);
Alert(direction == -1 and direction[1] == 1 and Alerts, "'Chandelier Exit' Sell!", Alert.ONCE, Sound.Ding);
Thank you.
1. How can I replace the chartBubble with UPARROW and DOWNARROW?
def buySignal = direction == 1 and direction[1] == -1;
#AddChartBubble(buySignal and ShowLabels, low, "Buy Signal", Color.Green, no);
Tried simply
plot buySignal; # did not work
Tried the below did not work.
def bS1;
plot bS1 = if direction == 1 and direction[1] == -1 and ShowLabels == yes then ??
2. How do I use this code for scanning?
#Chandelier Exit (Upper Study)
#Version 1.0 Released 04/10/22
#Created by CustomThinkscript
input ATRLength = 22;
input ATRMultiplier = 3;
input ShowLabels = yes;
input UseClose = yes;
input HighlightState = yes;
input Alerts = no;
def atr = ATRMultiplier * ATR(ATRLength);
def longStop = (if UseClose then highest(close, ATRLength) else highest(high, ATRLength)) - atr;
def longStopPrev = if IsNan(LongStop[1]) then longStop else LongStop[1];
def LS =if close[1] > longStopPrev then max(longStop, longStopPrev) else longStop;
def shortStop = (if UseClose then lowest(close, ATRLength) else lowest(low, ATRLength)) + atr;
def shortStopPrev = if IsNan(shortStop[1]) then shortStop else shortStop[1];
def SS =if close[1] < shortStopPrev then min(shortStop, shortStopPrev) else shortStop;
def dir = if close > shortStopPrev then 1 else if close < longStopPrev then -1 else dir[1];
def direction = dir;
plot LongStopPlot = if direction == 1 then LS else double.Nan;
longStopPlot.SetDefaultColor(Color.Green);
plot ShortStopPlot = if direction == -1 then SS else Double.Nan;
shortStopPlot.SetDefaultColor(Color.Red);
def midPricePlot = OHLC4;
def buySignal = direction == 1 and direction[1] == -1;
def sellSignal = direction == -1 and direction[1] == 1;
AddChartBubble(buySignal and ShowLabels, low, "Buy Signal", Color.Green, no);
AddChartBubble(sellSignal and ShowLabels, high, "Sell Signal", Color.Red, yes);
AddCloud(if direction == 1 and HighlightState then longStopPlot else Double.Nan, If direction == 1 and HighlightState then midPricePlot else Double.Nan, Color.Green, Color.Green, no);
AddCloud(if direction == -1 and HighlightState then shortStopPlot else Double.Nan, If direction == -1 and HighlightState then midPricePlot else Double.Nan, Color.Red, Color.Red, no);
Alert(direction == 1 and direction[1] == -1 and Alerts, "'Chandelier Exit' Buy!", Alert.ONCE, Sound.Ding);
Alert(direction == -1 and direction[1] == 1 and Alerts, "'Chandelier Exit' Sell!", Alert.ONCE, Sound.Ding);
Thank you.