Slim Ribbon -- OBV Indicator For ThinkOrSwim

I have minor experience with coding and have been able to share a few codes here. I am having trouble doing something I've done before in the past though and anyone that could help me would be greatly appreciated and if it's allowed in the rules I wouldn't mind paying.

Shared is the Slim Ribbon indicator- it's a 3 band momentum indicator. I was able to change the Input from PRICE to VOLUME- the attached picture is the result of that. It does a great job of showing volume droughts.

I wanted to create a similar indicator as my On Balance Volume indicator where it will show a color during healthy vol and another color during droughts- exactly how the bars are painted in the slim upper study except in the format of my on balance volume indicator.

I have been messing with this code for a while and just can't get it to work. Really any help is greatly appreciated. I also feel that the indicator would be helpful to others.

Note: The on balance volume indicator doesn't populate every bar because of the requirements unlike For the slim indicator it would populate every bar either being healthy volume or drought( the same it charts on the upper study) I am also going to keep trying to edit this and If I get anywhere I will update. All I can get is the signal to populate once in a lower study- I am trying to get it to repeat the same signal for every bar until the other signal is confirmed- so there isn't a bunch of empty space in the lower indicator area.


thank you!

Indicator Links:
SLIM: https://tos.mx/CQk0Wgo
On Balance: https://tos.mx/NumoWSn

Shared Chart Link : https://tos.mx/grW6cJn

RYIXdZV.png
 
Last edited:
Solution
@young_and_dumb Something like this?

deletelater.png


Code:
# Histogram Lower Based on Slim Ribbon Indicator

#hint: <b>Ask SLM Ribbon</b>\nThe Ask SLM Ribbon is a momentum indicator that uses a combination of three exponential moving averages. When the averages are in alinement, with the "superfast" moving average above the "fast" moving average and the fast moving average above the "slow" moving average, the momentum condition is positive. A "buy signal" is generated, with an up arrow, when above conditions are met and a "clear bar" occurs; with the low of that bar is above all of the moving averages. The positive momentum ends if the superfast moving average touches the fast moving average; then condition is considered neutral and an...
This is really the best I can do- I am not sure how to make the signal repaint once triggered until a change occurs- so that way there isn't empty space. I've tried a hand full of things- no luck

cheers

NOTE: this sample is not correlated with the first chart so the colors wont match- just showing the best I could do with the lower study edit


aiyLt8h.png
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

@young_and_dumb Something like this?

deletelater.png


Code:
# Histogram Lower Based on Slim Ribbon Indicator

#hint: <b>Ask SLM Ribbon</b>\nThe Ask SLM Ribbon is a momentum indicator that uses a combination of three exponential moving averages. When the averages are in alinement, with the "superfast" moving average above the "fast" moving average and the fast moving average above the "slow" moving average, the momentum condition is positive. A "buy signal" is generated, with an up arrow, when above conditions are met and a "clear bar" occurs; with the low of that bar is above all of the moving averages. The positive momentum ends if the superfast moving average touches the fast moving average; then condition is considered neutral and an oppostive arrow will appear. Negative momentum and a "Sell signal" are the opposite of the bullish conditions. \n \n\n--------------------------------------------------------------------------------\nVolume bars can be colored to match the Chart by clicking on Style>Settings>Appearance>Common, and color symbol as ticks  \n

declare lower;

input price = volume;
input superfast_length = 8;
input fast_length = 13;
input slow_length = 21;
input displace = 0;

def mov_avg8 = ExpAverage(price[-displace], superfast_length);
def mov_avg13 = ExpAverage(price[-displace], fast_length);
def mov_avg21 = ExpAverage(price[-displace], slow_length);
def buy_ = mov_avg8 > mov_avg13 and mov_avg13 > mov_avg21 and low > mov_avg8;
def stopbuy = mov_avg8 <= mov_avg13;
def buynow = !buy_[1] and buy_;
def buysignal = if buynow and !stopbuy then 1 else if buysignal[1]==1 and stopbuy then 0 else buysignal[1];
 def sell_ = mov_avg8 < mov_avg13 and mov_avg13 < mov_avg21 and high < mov_avg8;
def stopsell = mov_avg8 >= mov_avg13;
def sellnow = !sell_[1] and sell_;
def sellsignal = if sellnow and !stopsell then 1 else if sellsignal[1]==1 and stopsell then 0 else sellsignal[1];

 
plot buy = if buysignal == 1 then 1 else 0;
     buy.setdefaultcolor(color.dark_green);
buy.setpaintingstrategy(paintingstrategy.histogram);
plot sell = if sellsignal == 1 then 1 else 0;
     sell.setdefaultcolor(color.red);
sell.setpaintingstrategy(paintingstrategy.histogram);
plot neutral = if buysignal == 0 and sellsignal == 0 then 1 else 0;
     neutral.setdefaultcolor(color.plum);
neutral.setpaintingstrategy(paintingstrategy.histogram);

# end
 
Solution

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
373 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top