Shared_AccdistStoch_Signal21 watchlist

iSultan

Member
VIP
I would like to add indicator ( Shared_AccdistStoch_Signal21 ) (1.0.yes ) to watchlist
Column for ( Shared_AccdistStoch_Signal21 ) is showing the value for ex : o , -12 , 6
Time frame ( 5 min )

I tried using custom but unfortunately no result .
If anyone can help

p_1806wadt51.png


Code:
declare lower;
input overbought = 1;
input oversold = 0;

def data = if close > close[1] then close - Min(close[1], low) else if close < close[1] then close - Max(close[1], high) else 0;

def over_bought = overbought;
def over_sold = oversold;

def AD = TotalSum(data);
plot AccDist = (AD - LowestAll(AD)) / (HighestAll(AD) - LowestAll(AD));
AccDist.SetDefaultColor(GetColor(1));

def stoch1 = StochasticSlow("over bought" = 100, "over sold" = 0, "k period" = 9, "d period" = 3).SlowD;
#plot SlowD1 =  (stoch1 - LowestAll(stoch1)) / (HighestAll(stoch1) - LowestAll(stoch1));
#SlowD1.SetDefaultColor(GetColor(3));

def stoch2 = StochasticSlow("overbought" = 100, "over sold" = 0, "k period" = 5, "d period" = 3).SlowD;
#plot SlowD2 =  (stoch2 - LowestAll(stoch2)) / (HighestAll(stoch2) - LowestAll(stoch2));
#SlowD2.SetDefaultColor(GetColor(5));

plot one = 1;
plot zero = 0;
#plot half = 0.5;
input showBreakoutSignals = yes;

plot signalup = if AccDist crosses above over_sold then over_sold else Double.NaN;
signalup.SetHiding(!showBreakoutSignals);
signalup.SetDefaultColor(Color.Green);
signalup.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
signalup.HideTitle();

plot signaldown = if AccDist crosses below over_bought then over_bought else Double.NaN;
signaldown.SetHiding(!showBreakoutSignals);
signaldown.SetDefaultColor(Color.Red);
signaldown.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
signaldown.HideTitle();

# Alerts
Alert(signalup, "BUY BUY BUY ", Alert.Bar, Sound.Chimes);
Alert(signaldown, "SELL SELL SELL ", Alert.Bar, Sound.Bell);
 
Last edited by a moderator:

BenTen

Administrative
Staff member
Staff
VIP
Here is the code for your watchlist column:

Code:
input overbought = 1;
input oversold = 0;

def data = if close > close[1] then close - Min(close[1], low) else if close < close[1] then close - Max(close[1], high) else 0;

def over_bought = overbought;
def over_sold = oversold;

def AD = TotalSum(data);
plot AccDist = (AD - LowestAll(AD)) / (HighestAll(AD) - LowestAll(AD));

HVd5Jgj.png
 

iSultan

Member
VIP
BEN . there is different between the chart and the watchlist .

watchlist for AAPL the number ( .72 )

p_1814u2i6o1.png


in the chart the number ( .41834 )

p_18149yunj1.png


I tried all the time frame but still the same the numbers not match

p_1814by3sk1.png
 

BenTen

Administrative
Staff member
Staff
VIP
@iSultan That is because the timeframe setting from the watchlist column is a bit different. Not the time period, but the setting that's being set by ThinkorSwim.

Go to your chart's settings > Equities > uncheck "Start aggregations at market."

pQHkW4Y.png


After that, the number should be the same.
 

Similar threads

Top