somebody here posted a study i think it was called slim ribbon? Anyway, I modified it and got this. The default settings seem to work the best, but the settings are all adjustable. Use this with your filtering studies for momentum and cycles to verify the best signals, though this almost works pretty good on its own.
The filter inputs (L for long and s for short) are the SMA it uses to filter bullish/bearish trends.
the sensitivity inputs for L and S are the SMA it uses to determine which SMA will act as the exit.
**** I would like to see if someone can convert this to a strategy so i can see which settings are optimal for each equity. Can someone do that? Im SUPER curious how this would perform just as a standalone buy/sell signal.
thanks!
https://tos.mx/CEerPVb
Also, idk how to make my image into a link that would allow me to post it. ill update if i figure it out
The filter inputs (L for long and s for short) are the SMA it uses to filter bullish/bearish trends.
the sensitivity inputs for L and S are the SMA it uses to determine which SMA will act as the exit.
**** I would like to see if someone can convert this to a strategy so i can see which settings are optimal for each equity. Can someone do that? Im SUPER curious how this would perform just as a standalone buy/sell signal.
thanks!
https://tos.mx/CEerPVb
Also, idk how to make my image into a link that would allow me to post it. ill update if i figure it out
input price = close;
input superfast_length = 5;
input fast_length = 9;
input slow_length = 18;
input filterL = 18;
input filterS = 18;
input sensitivityL = 12;
input sensitivityS = 9;
input displace = 0;
def mov_avg5 = simpleMovingAvg(price[-displace], superfast_length);
def mov_avg9 = simpleMovingAvg(price[-displace], fast_length);
def mov_avg18 = simpleMovingAvg(price[-displace], slow_length);
def mov_avg45 = simpleMovingAvg(price[-displace], 45);
def mov_avg150 = simpleMovingAvg(price[-displace], 150);
def filter_L = simpleMovingAvg(price[-displace], filterL);
def filter_S = simpleMovingAvg(price[-displace], filterS);
def sens_L = simpleMovingAvg(price[-displace], sensitivityL);
def sens_S = simpleMovingAvg(price[-displace], sensitivityS);
#moving averages
Plot Superfast = mov_avg5;
plot Fast = mov_avg9;
plot Slow = mov_avg18;
def buy = mov_avg5 > mov_avg9 and close > filter_L;
def stopbuy = close < sens_L;# or close crosses below BollingerBands("length" = 18)."UpperBand";
def buynow = !buy[1] and buy;
def buysignal = CompoundValue(1, if buynow and !stopbuy then 1 else if buysignal[1]==1 and stopbuy then 0 else buysignal[1], 0);
plot Buy_Signal = buysignal[1] == 0 and buysignal==1;
Buy_signal.setpaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
Buy_signal.setdefaultColor(color.GREEN);
Buy_signal.hidetitle();
Alert(condition = buysignal[1] == 0 and buysignal == 1, text = "Buy Signal", sound = Sound.Bell, "alert type" = Alert.BAR);
plot Momentum_Down = buysignal[1] ==1 and buysignal==0;
Momentum_down.setpaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
Momentum_Down.setdefaultColor(color.cyan);
Momentum_down.hidetitle();
Alert(condition = buysignal[1] == 1 and buysignal == 0, text = "Momentum_Down", sound = Sound.Bell, "alert type" = Alert.BAR);
def sell = mov_avg5 < mov_avg9 and close < filter_S;
def stopsell = close > sens_S; #or close crosses above BollingerBands("length" = 18)."LowerBand";
def sellnow = !sell[1] and sell;
def sellsignal = CompoundValue(1, if sellnow and !stopsell then 1 else if sellsignal[1]==1 and stopsell then 0 else sellsignal[1], 0);
Plot Sell_Signal = sellsignal[1] ==0 and sellsignal;
Sell_signal.setpaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_down);
sell_signal.setDefaultColor(color.red);
Sell_signal.hidetitle();
Alert(condition = sellsignal[1] == 0 and sellsignal == 1, text = "Sell Signal", sound = Sound.Bell, "alert type" = Alert.BAR);
Plot Momentum_Up = sellsignal[1]==1 and sellSignal==0;
Momentum_up.setpaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_up);
Momentum_up.setDefaultColor(color.orange);
Momentum_up.hidetitle();
Alert(condition = sellsignal[1] == 1 and sellSignal == 0, text = "Momentum_Up", sound = Sound.Bell, "alert type" = Alert.BAR);
plot Colorbars = if buysignal ==1 then 1 else if sellsignal ==1 then 2 else if buysignal ==0 or sellsignal==0 then 3 else 0;
colorbars.hide();
Colorbars.definecolor("Buy_Signal_Bars", color.green);
Colorbars.definecolor("Sell_Signal_Bars", color.red);
Colorbars.definecolor("Neutral", color.yellow);
AssignPriceColor(if Colorbars ==1 then colorbars.color("buy_signal_bars") else if colorbars ==2 then colorbars.color("Sell_Signal_bars") else colorbars.color("neutral"));
superfast.setdefaultcolor(color.white);
fast.setdefaultColor(color.cyan);
slow.setdefaultColor(color.yellow);
#end
Last edited: