ATR and buy sell volume

cabe1332

Active member
Hi @cabe1332 can you point me to your ATR and buy , sell volume indicator from your chart
@Mula can copy and paste which screenshot you referring to so I can share the script. Below is my ATR script. Volume indicator you mentioned, be specific. I have changed some since. @cabe1332

# ATR by @cabe1332

# start_code
declare lower;

input length = 14;
input averageType = AverageType.WILDERS;

plot ATR = MovingAverage(averageType, TrueRange(high, close, low), length);
ATR.SetDefaultColor(GetColor(8));
ATR.DefineColor("Up", GetColor(1));
ATR.DefineColor("Down", GetColor(0));
ATR.AssignValueColor(if ATR > ATR[1] then ATR.color("Up") else ATR.color("Down"));
#end_code
 

Mula

New member
@Mula can copy and paste which screenshot you referring to so I can share the script. Below is my ATR script. Volume indicator you mentioned, be specific. I have changed some since. @cabe1332

# ATR by @cabe1332

# start_code
declare lower;

input length = 14;
input averageType = AverageType.WILDERS;

plot ATR = MovingAverage(averageType, TrueRange(high, close, low), length);
ATR.SetDefaultColor(GetColor(8));
ATR.DefineColor("Up", GetColor(1));
ATR.DefineColor("Down", GetColor(0));
ATR.AssignValueColor(if ATR > ATR[1] then ATR.color("Up") else ATR.color("Down"));
#end_code
I am referring to last section in your chart setups where in I can see buy volume and sell volume and also slows labels which includes current bar buying and selling volume.

second thing I am using trend reversal indicator but it’s repainting. And how to change the wording reversal to buy and sell in that indicator?
 

cabe1332

Active member
I am referring to last section in your chart setups where in I can see buy volume and sell volume and also slows labels which includes current bar buying and selling volume.

second thing I am using trend reversal indicator but it’s repainting. And how to change the wording reversal to buy and sell in that indicator?
@Mula for the buy/sell volume you can start here: https://usethinkscript.com/threads/buy-and-sell-volume-pressure-indicator-for-thinkorswim.578/

For the trend reversal make sure you have the proper version. Do a search and read the thread. Once you have the proper script to modify the wording, look at line 128 down for "AddChartBubble". You can modify the code to include what you like it to be.

Good luck! @cabe1332
 

taifur005

New member
@Mula for the buy/sell volume you can start here: https://usethinkscript.com/threads/buy-and-sell-volume-pressure-indicator-for-thinkorswim.578/

For the trend reversal make sure you have the proper version. Do a search and read the thread. Once you have the proper script to modify the wording, look at line 128 down for "AddChartBubble". You can modify the code to include what you like it to be.

Good luck! @cabe1332
Hi @cabe1332 I am trying to add two labels in my chart at top left or right . One is RSI value and another is ATR. Both are TOS calculated data. Can you please help me?
 

cabe1332

Active member
Hi @cabe1332 I am trying to add two labels in my chart at top left or right . One is RSI value and another is ATR. Both are TOS calculated data. Can you please help me?
Hey @taifur005, your request for the labels available on this site. You just need to put in some time and patience. But, here's what I have, code below. Good luck! @cabe1332 .

#### RSI ####
# @cabe1332
input rsilength = 5;
def rsi = reference RSI(length = rsilength)."RSI";

# RSI Bullish/Bearish Trend Label
# Ind if RSI above/below 50 Bullish/Bearish

AddLabel(yes,
if rsi > 50
then "RSI Trend: Bullish "
else "RSI Trend: Bearish ",
if rsi > 50 then Color.green else Color.red);

# end code RSI Bullish/Bearish Trend

# RSI Label
AddLabel(yes,
if rsi < 20 then "RSI Oversold: " + round(rsi,0) + " " else
if rsi > 80 then "RSI Overbought: " +round(rsi,0) + " " else
if rsi > rsi[1] then "RSI Rising: " + round(rsi,0) + " " else "RSI Falling: " +round(rsi,0) + " ",
if rsi < 20 then Color.orange else
if rsi > 80 then Color.red else
if rsi < 20 or rsi > 80 then Color.yellow else Color.light_gray);

# end code RSI #


#### ATR ####
# @cabe1332

input ATRPeriod = 14;
input period = AggregationPeriod.day;
def ATR = MovingAverage(AverageType.WILDERS, TrueRange(high(period = period), close(period = period), low(period = period)), ATRperiod);
def ATRpct = Round((ATR / close), 2);

AddLabel(yes, "Daily ATR: " + Round(ATR,2)+ " | " + AsPercent(ATRpct), color.light_gray);

# end ATR code
 

taifur005

New member
Hey @taifur005, your request for the labels available on this site. You just need to put in some time and patience. But, here's what I have, code below. Good luck! @cabe1332 .

#### RSI ####
# @cabe1332
input rsilength = 5;
def rsi = reference RSI(length = rsilength)."RSI";

# RSI Bullish/Bearish Trend Label
# Ind if RSI above/below 50 Bullish/Bearish

AddLabel(yes,
if rsi > 50
then "RSI Trend: Bullish "
else "RSI Trend: Bearish ",
if rsi > 50 then Color.green else Color.red);

# end code RSI Bullish/Bearish Trend

# RSI Label
AddLabel(yes,
if rsi < 20 then "RSI Oversold: " + round(rsi,0) + " " else
if rsi > 80 then "RSI Overbought: " +round(rsi,0) + " " else
if rsi > rsi[1] then "RSI Rising: " + round(rsi,0) + " " else "RSI Falling: " +round(rsi,0) + " ",
if rsi < 20 then Color.orange else
if rsi > 80 then Color.red else
if rsi < 20 or rsi > 80 then Color.yellow else Color.light_gray);

# end code RSI #


#### ATR ####
# @cabe1332

input ATRPeriod = 14;
input period = AggregationPeriod.day;
def ATR = MovingAverage(AverageType.WILDERS, TrueRange(high(period = period), close(period = period), low(period = period)), ATRperiod);
def ATRpct = Round((ATR / close), 2);

AddLabel(yes, "Daily ATR: " + Round(ATR,2)+ " | " + AsPercent(ATRpct), color.light_gray);

# end ATR code
Thank you very much. I was searching but may be my search words could not reach to correct code. I really appreciate your help. @cabe1332
 

Similar threads

Top