# B4 Watchlist Column # # Free for use for non commercial. Header credits must be included when any form of the code included in this package is used. # User assumes all risk. Author not responsible for errors or use of tool. # Copyright (c) 2021 B4 Signals # # Get support at: https://b4signals.com # Join us at: https://discord.gg/kD3pKE2CQd # # # v3.0 - barbros / chuck - official release ### MACDBB input MACDBB_FastLength = 12; input MACDBB_SlowLength = 26; input MACDBB_BandLength = 15; input MACDBB_NumDev = 1.0; def MACDBB_Data = MACD(fastLength = MACDBB_FastLength, slowLength = MACDBB_SlowLength, MACDLength = 5); def MACDBB_Upper = reference BollingerBands(price = MACDBB_Data, length = MACDBB_BandLength, Num_Dev_Dn = -MACDBB_NumDev, Num_Dev_Up = MACDBB_NumDev).UpperBand;; def MACDBB_Lower = reference BollingerBands(price = MACDBB_Data, length = MACDBB_BandLength, Num_Dev_Dn = -MACDBB_NumDev, Num_Dev_Up = MACDBB_NumDev).Lowerband; def MACDBB_Buy = MACDBB_Data > MACDBB_Upper; def MACDBB_Sell = MACDBB_Data <= MACDBB_Lower; ### RSI/STOCASTIC/MACD CONFLUENCE COMBO def RSM_MACD_Diff = reference MACD(fastLength = 12, slowLength = 26, MACDLength = 9).Diff; def RSM_MACD_ZeroLine = 0; def RSM_RSI = reference RSI(length = 7).RSI; def RSM_Stoch_Val = 100 * (close - lowest(low, 14)) / (highest(high, 14) - lowest(low, 14)); def RSM_StochSlowK = SimpleMovingAvg(SimpleMovingAvg(RSM_Stoch_Val,3),3); def RSM_rsiGreen = RSM_RSI >= 50; def RSM_rsiRed = RSM_RSI < 50; def RSM_stochGreen = RSM_StochSlowK >= 50; def RSM_stochRed = RSM_StochSlowK < 50; def RSM_macdGreen = RSM_MACD_Diff >= 0; def RSM_macdRed = RSM_MACD_Diff < 0; def RSM_Buy = RSM_rsiGreen and RSM_stochGreen and RSM_macdGreen; def RSM_Sell = RSM_rsiRed and RSM_stochRed and RSM_macdRed; ### RSI IFT def RSI_IFT_R = reference RSI(5, close) - 50; def RSI_IFT_AvgRSI = MovingAverage(AverageType.Exponential,RSI_IFT_R,9); def RSI_IFT_InverseRSI = (Power(Double.E, 2 * RSI_IFT_AvgRSI) - 1) / (Power(Double.E, 2 * RSI_IFT_AvgRSI) + 1); def RSI_IFT_Direction = if BarNumber() == 0 then 0 else if (RSI_IFT_InverseRSI[1] > 0) and (RSI_IFT_InverseRSI < 0) then -1 else if (RSI_IFT_InverseRSI > 0) and (RSI_IFT_InverseRSI[1] < 0) then 1 else RSI_IFT_Direction[1]; ### Fibonacci SuperTrend input FST_Length = 11; input FST_Retrace = 23.6; input FST_UseHighLow = yes; def FST_h = if FST_UseHighLow then high else close; def FST_l = if FST_UseHighLow then low else close; def FST_minL = Lowest(FST_l, FST_Length); def FST_maxH = Highest(FST_h, FST_Length); def FST_hh = if FST_h > FST_maxH[1] then FST_h else FST_hh[1]; def FST_ll = if FST_l < FST_minL[1] then FST_l else FST_ll[1]; def FST_trend = if FST_h > FST_maxH[1] then 1 else if FST_l < FST_minL[1] then -1 else FST_trend[1]; def FST_Direction = if BarNumber() == 0 then 0 else if FST_trend != 1 then -1 else if FST_trend == 1 then 1 else FST_Direction[1]; ### Strategy input BullBear_Include_FST = yes; #hint BullBear_Include_FST: Include Fibonacci SuperTrend in the vertical line strategy input BullBear_Include_RSI_IFT = yes; #hint BullBear_Include_RSI_IFT: Include RSI IFT in the vertical line strategy def BullBear_Buy = (!BullBear_Include_FST or FST_Direction == 1) and (!BullBear_Include_RSI_IFT or RSI_IFT_Direction == 1); def BullBear_Sell = (!BullBear_Include_FST or FST_Direction == -1) and (!BullBear_Include_RSI_IFT or RSI_IFT_Direction == -1); def Strategy_Buy = BullBear_Buy and MACDBB_Buy and RSM_Buy; def Strategy_Sell = BullBear_Sell and MACDBB_Sell and RSM_Sell; AssignBackgroundColor( if Strategy_Buy and !Strategy_Buy[1] then Color.GREEN else if Strategy_Sell and !Strategy_Sell[1] then Color.RED else color.CURRENT ); AddLabel(yes, if Strategy_Buy and !Strategy_Buy[1] then "Buy" else if Strategy_Sell and !Strategy_Sell[1] then "Sell" else if Strategy_Buy then "Long" else if Strategy_Sell then "Short" else "Neutral", if Strategy_Buy and !Strategy_Buy[1] then Color.BLACK else if Strategy_Sell and !Strategy_Sell[1] then Color.WHITE else if Strategy_Buy then Color.LIGHT_GREEN else if Strategy_Sell then Color.LIGHT_RED else Color.CURRENT );