Need minor help with editing Ask Slim Ribbons

young_and_dumb

New member
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?



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...

young_and_dumb

New member
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
 

Pensar

Active member
VIP
@young_and_dumb Something like this?



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

Top