//@version=5 strategy("Oluwoleajiboso Strategy", overlay = true, max_labels_count = 500,process_orders_on_close = true) C_Len = 14 // ta.ema depth for bodyAvg C_ShadowPercent = 5.0 // size of shadows C_ShadowEqualsPercent = 100.0 C_DojiBodyPercent = 5.0 C_Factor = 2.0 // shows the number of times the shadow dominates the candlestick body C_BodyHi = math.max(close, open) C_BodyLo = math.min(close, open) C_Body = C_BodyHi - C_BodyLo C_BodyAvg = ta.ema(C_Body, C_Len) C_SmallBody = C_Body < C_BodyAvg C_LongBody = C_Body > C_BodyAvg C_UpShadow = high - C_BodyHi C_DnShadow = C_BodyLo - low C_HasUpShadow = C_UpShadow > C_ShadowPercent / 100 * C_Body C_HasDnShadow = C_DnShadow > C_ShadowPercent / 100 * C_Body C_WhiteBody = open < close C_BlackBody = open > close C_Range = high-low C_IsInsideBar = C_BodyHi[1] > C_BodyHi and C_BodyLo[1] < C_BodyLo C_BodyMiddle = C_Body / 2 + C_BodyLo C_ShadowEquals = C_UpShadow == C_DnShadow or (math.abs(C_UpShadow - C_DnShadow) / C_DnShadow * 100) < C_ShadowEqualsPercent and (math.abs(C_DnShadow - C_UpShadow) / C_UpShadow * 100) < C_ShadowEqualsPercent C_IsDojiBody = C_Range > 0 and C_Body <= C_Range * C_DojiBodyPercent / 100 C_Doji = C_IsDojiBody and C_ShadowEquals patternLabelPosLow = low - (ta.atr(30) * 0.6) patternLabelPosHigh = high + (ta.atr(30) * 0.6) label_color_bullish = input(color.blue, "Marubozu White - Bullish") C_MarubozuWhiteBullishNumberOfCandles = 1 C_MarubozuShadowPercentWhite = 5.0 C_MarubozuWhiteBullish = C_WhiteBody and C_LongBody and C_UpShadow <= C_MarubozuShadowPercentWhite/100*C_Body and C_DnShadow <= C_MarubozuShadowPercentWhite/100*C_Body and C_WhiteBody // alertcondition(C_MarubozuWhiteBullish, title = "New pattern detected", message = "New Marubozu White – Bullish pattern detected") if C_MarubozuWhiteBullish var ttBullishMarubozuWhite = "Marubozu White\nA Marubozu White Candle is a candlestick that does not have a shadow that extends from its candle body at either the open or the close. Marubozu is Japanese for “close-cropped” or “close-cut.” Other sources may call it a Bald or Shaven Head Candle." label.new(bar_index, patternLabelPosLow, text="MW", style=label.style_label_up, color = label_color_bullish, textcolor=color.white, tooltip = ttBullishMarubozuWhite) bgcolor(ta.highest(C_MarubozuWhiteBullish?1:0, C_MarubozuWhiteBullishNumberOfCandles)!=0 ? color.new(color.blue, 90) : na, offset=-(C_MarubozuWhiteBullishNumberOfCandles-1)) label_color_bearish = input(color.red, "Marubozu Black - Bearish") C_MarubozuBlackBearishNumberOfCandles = 1 C_MarubozuShadowPercentBearish = 5.0 C_MarubozuBlackBearish = C_BlackBody and C_LongBody and C_UpShadow <= C_MarubozuShadowPercentBearish/100*C_Body and C_DnShadow <= C_MarubozuShadowPercentBearish/100*C_Body and C_BlackBody // alertcondition(C_MarubozuBlackBearish, title = "New pattern detected", message = "New Marubozu Black – Bearish pattern detected") if C_MarubozuBlackBearish var ttBearishMarubozuBlack = "Marubozu Black\nThis is a candlestick that has no shadow, which extends from the red-bodied candle at the open, the close, or even at both. In Japanese, the name means “close-cropped” or “close-cut.” The candlestick can also be referred to as Bald or Shaven Head." label.new(bar_index, patternLabelPosHigh, text="MB", style=label.style_label_down, color = label_color_bearish, textcolor=color.white, tooltip = ttBearishMarubozuBlack) bgcolor(ta.highest(C_MarubozuBlackBearish?1:0, C_MarubozuBlackBearishNumberOfCandles)!=0 ? color.new(color.red, 90) : na, offset=-(C_MarubozuBlackBearishNumberOfCandles-1)) htf1_mb_on = input.bool(true,"White & Black Marubozu on HTF",inline = "mb1") htf1_mb_tf = input.timeframe("","",inline = "mb1") htf2_mb_on = input.bool(true,"White & Black Marubozu on HTF",inline = "mb2") htf2_mb_tf = input.timeframe("","",inline = "mb2") htf3_mb_on = input.bool(true,"White & Black Marubozu on HTF",inline = "mb3") htf3_mb_tf = input.timeframe("","",inline = "mb3") htf4_mb_on = input.bool(true,"White & Black Marubozu on HTF",inline = "mb4") htf4_mb_tf = input.timeframe("","",inline = "mb4") // -- // grp1 = 'RMI Trend Sniper' // ** ---> Inputs ------------- { var bool positive = false var bool negative = false string RSI_group = "RMI Settings" string mom_group = "Range Vales" string visual = "Visuals" rmi_on = input.bool(true,"Enable RMI Trend Sniper",group = RSI_group) int Length = input(14,"RMI Length ",inline = "RMI",group = RSI_group) int pmom = input(66," Positive above",inline = "rsi1",group =RSI_group ) int nmom = input(30,"Negative below",inline = "rsi1",group =RSI_group ) bool filleshow = input(true,"Show Range MA ",inline = "002",group =visual ) color bull = input(#00bcd4,"",inline = "002",group =visual ) color bear = input(#ff5252,"",inline = "002",group =visual ) float BarRange = high - low up = ta.rma(math.max(ta.change(close), 0), Length) down = ta.rma(-math.min(ta.change(close), 0), Length) rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down)) mf = ta.mfi(hlc3, Length) rsi_mfi = math.avg(rsi,mf) //------------------- } bool p_mom = rsi_mfi[1] < pmom and rsi_mfi > pmom and rsi_mfi > nmom and ta.change(ta.ema(close,5)) > 0 bool n_mom = rsi_mfi < nmom and ta.change(ta.ema(close,5)) < 0 // // ---> Momentums ------------- { if p_mom positive:= true negative:= false if n_mom positive:= false negative:= true // method _Band(int len)=> math.min (ta.atr (len) * 0.3, close * (0.3/100)) [20] /2 * 8 Band = _Band(30) method rangeMA(float Range,Prd)=> weight = Range / math.sum(Range, Prd) sum = math.sum(close * weight, Prd) tw= math.sum(weight, Prd) sum / tw // Calculate the RWMA rwma = rangeMA(BarRange,20) // Plotting the RWMA. colour = positive ? bull : bear col_70 = positive ? color.new(bull,70) : color.new(bear,70) col_75 = positive ? color.new(bull,75) : color.new(bear,75) col_80 = positive ? color.new(bull,80) : color.new(bear,80) col_90 = positive ? color.new(bull,90) : color.new(bear,90) RWMA = positive ? rwma - Band : negative ? rwma + Band : na alpha = color.new(color.black, 100) center = plot(filleshow ? RWMA : na, "RRTH", colour, editable = true) rmi_b = rmi_on ?close>RWMA and positive : true rmi_s = rmi_on ?close syminfo.mintick * (syminfo.type == "forex" or syminfo.ticker=="XAUUSD" ? 10 : 1) sps = strategy.position_size //------------------------------------------------------------------------------ //Settings //-----------------------------------------------------------------------------{ length = input.int(14, 'Trend Length' , minval = 0) alpha2 = input.float(50, 'Convergence' , minval = 0 , maxval = 100) smooth = input.int(7, 'Smooth' , minval = 1) // //Patterns enable_wm = input(true, 'White Marubozu' , group = 'patterns') enable_bm = input(true, 'Black Marubozu' , group = 'patterns') //Style bull_css = input(#0cb51a, 'Bullish Color' , group = 'Style') bear_css = input(#ff1100, 'Bearish Color' , group = 'Style') //-----------------------------------------------------------------------------} //Variables/Functions //-----------------------------------------------------------------------------{ n = bar_index o = open,h = high,l = low,c = close atr = ta.atr(20) / 2 st = ta.stoch(c, c, c, length) downtrend = st < 50 uptrend = st > 50 d = math.abs(c - o) //Label lbl(y, txt, direction, tlt)=> label.new(n, y, txt , size = size.tiny , style = direction == 1 ? label.style_label_up : label.style_label_down , color = direction == 1 ? bull_css : bear_css , textcolor = color.white , tooltip = tlt) //-----------------------------------------------------------------------------} //Tooltips //-----------------------------------------------------------------------------{ var wm_tlt = "The white marubozu is a single candles formation formed after a downtrend and indicating a bullish reversal." + "\n" + "\nThis candlestick has a long bullish body with no upper or lower shadows, reflecting a strong buying pressure." var bm_tlt = "The black marubozu is a single candles formation formed after an uptrend and indicating a bearish reversal." + "\n" + "\nThis candlestick has a long bearish body with no upper or lower shadows, reflecting a strong selling pressure." //-----------------------------------------------------------------------------} //Pattern Rules //-----------------------------------------------------------------------------{ bulleng = downtrend and c > o and c[1] < o[1] and c > o[1] and d > atr beareng = uptrend and c < o and c[1] > o[1] and c < o[1] and d > atr wm = c > o and h - math.max(o, c) + math.min(o, c) - l < d / 10 and d > atr and downtrend[1] bm = c < o and h - math.max(o, c) + math.min(o, c) - l < d / 10 and d > atr and uptrend[1] //-----------------------------------------------------------------------------} //Channel //-----------------------------------------------------------------------------{ var max = h var min = l if wm and enable_wm max += alpha2 / 100 * (c - max) lbl(low, 'WM', 1, wm_tlt) if bm and enable_bm min += alpha2 / 100 * (c - min) lbl(high, 'BM', 0, bm_tlt) max := math.max(c, max) min := math.min(c, min) // -- candles DojiSize = input.float(0.05, minval=0.01, title='Doji size') data = math.abs(open - close) <= (high - low) * DojiSize plotchar(data, title='Doji', text='Doji', color=color.new(color.white, 0)) data2 = close[2] > open[2] and math.min(open[1], close[1]) > close[2] and open < math.min(open[1], close[1]) and close < open plotshape(data2, title='Evening Star', color=color.new(color.red, 0), style=shape.arrowdown, text='Evening\nStar') data3 = close[2] < open[2] and math.max(open[1], close[1]) < close[2] and open > math.max(open[1], close[1]) and close > open plotshape(data3, title='Morning Star', location=location.belowbar, color=color.new(color.lime, 0), style=shape.arrowup, text='Morning\nStar') data4 = open[1] < close[1] and open > close[1] and high - math.max(open, close) >= math.abs(open - close) * 3 and math.min(close, open) - low <= math.abs(open - close) plotshape(data4, title='Shooting Star', color=color.new(color.red, 0), style=shape.arrowdown, text='Shooting\nStar') data5 = high - low > 3 * (open - close) and (close - low) / (.001 + high - low) > 0.6 and (open - low) / (.001 + high - low) > 0.6 plotshape(data5, title='Hammer', location=location.belowbar, color=color.new(color.white, 0), style=shape.diamond, text='H') data5b = high - low > 3 * (open - close) and (high - close) / (.001 + high - low) > 0.6 and (high - open) / (.001 + high - low) > 0.6 plotshape(data5b, title='Inverted Hammer', location=location.belowbar, color=color.new(color.white, 0), style=shape.diamond, text='IH') data6 = close[1] > open[1] and open > close and open <= close[1] and open[1] <= close and open - close < close[1] - open[1] plotshape(data6, title='Bearish Harami', color=color.new(color.red, 0), style=shape.arrowdown, text='Bearish\nHarami') data7 = open[1] > close[1] and close > open and close <= open[1] and close[1] <= open and close - open < open[1] - close[1] plotshape(data7, title='Bullish Harami', location=location.belowbar, color=color.new(color.lime, 0), style=shape.arrowup, text='Bullish\nHarami') data8 = close[1] > open[1] and open > close and open >= close[1] and open[1] >= close and open - close > close[1] - open[1] plotshape(data8, title='Bearish Engulfing', color=color.new(color.red, 0), style=shape.arrowdown, text='Bearish\nEngulfing') data9 = open[1] > close[1] and close > open and close >= open[1] and close[1] >= open and close - open > open[1] - close[1] plotshape(data9, title='Bullish Engulfing', location=location.belowbar, color=color.new(color.lime, 0), style=shape.arrowup, text='Bullish\nEngulfling') upper = ta.highest(10)[1] data10 = close[1] < open[1] and open < low[1] and close > close[1] + (open[1] - close[1]) / 2 and close < open[1] plotshape(data10, title='Piercing Line', location=location.belowbar, color=color.new(color.lime, 0), style=shape.arrowup, text='Piercing\nLine') lower = ta.lowest(10)[1] data11 = low == open and open < lower and open < close and close > (high[1] - low[1]) / 2 + low[1] plotshape(data11, title='Bullish Belt', location=location.belowbar, color=color.new(color.lime, 0), style=shape.arrowup, text='Bullish\nBelt') data12 = open[1] > close[1] and open >= open[1] and close > open plotshape(data12, title='Bullish Kicker', location=location.belowbar, color=color.new(color.lime, 0), style=shape.arrowup, text='Bullish\nKicker') data13 = open[1] < close[1] and open <= open[1] and close <= open plotshape(data13, title='Bearish Kicker', color=color.new(color.red, 0), style=shape.arrowdown, text='Bearish\nKicker') data14 = high - low > 4 * (open - close) and (close - low) / (.001 + high - low) >= 0.75 and (open - low) / (.001 + high - low) >= 0.75 and high[1] < open and high[2] < open plotshape(data14, title='Hanging Man', color=color.new(color.red, 0), style=shape.arrowdown, text='Hanging\nMan') data15 = close[1] > open[1] and (close[1] + open[1]) / 2 > close and open > close and open > close[1] and close > open[1] and (open - close) / (.001 + high - low) > 0.6 plotshape(data15, title='Dark Cloud Cover', color=color.new(color.red, 0), style=shape.arrowdown, text='Dark\nCloudCover') // //@version=5 // indicator(title='3 Line Strike [TTF]', shorttitle='3LS [TTF]', overlay=true) // Inputs // // ### 3 Line Strike // showBear3LS = input.bool(title='Show Bearish 3 Line Strike', defval=true, group='3 Line Strike', tooltip="The Bearish 3 Line Strike (3LS-Bear) is a candlestick pattern comprised of 3 bullish (green) candles, " + "followed by a bearish engulfing candle (see 'Big A$$ Candles' below).\n\n" + "This pattern tends to be best used as a signal of the end of a retracement period as part of a trend continuation strategy.\n\n" + "Default: Checked") showBull3LS = input.bool(title='Show Bullish 3 Line Strike', defval=true, group='3 Line Strike', tooltip="The Bullish 3 Line Strike (3LS-Bull) is a candlestick pattern comprised of 3 bearish (red) candles, " + "followed by a bullish engulfing candle (see 'Big A$$ Candles' below).\n\n" + "This pattern tends to be best used as a signal of the end of a retracement period as part of a trend continuation strategy.\n\n" + "Default: Checked") showMemeChars = input.bool(title="Plot 3 Line Strike meme symbols", defval=false, group="3 Line Strike", tooltip="If disabled (default), standard shapes will be plotted instead, which can then be further customized on the 'Styles' tab of the indicator settings.\n\n" + "If enabled, meme icons hand-selected by Arty himself (🍆 and 🍑) will be plotted for 3LS signals instead of the more typical shapes.\n\n" + "Default: Unchecked") // getCandleColorIndex(barIndex) => int ret = na if (close[barIndex] > open[barIndex]) ret := 1 else if (close[barIndex] < open[barIndex]) ret := -1 else ret := 0 ret // // Check for engulfing candles isEngulfing(checkBearish) => // In an effort to try and make this a bit more consistent, we're going to calculate and compare the candle body sizes // to inform the engulfing or not decision, and only use the open vs close comparisons to identify the candle "color" ret = false sizePrevCandle = close[1] - open[1] // negative numbers = red, positive numbers = green, 0 = doji sizeCurrentCandle = close - open // negative numbers = red, positive numbers = green, 0 = doji isCurrentLagerThanPrevious = (math.abs(sizeCurrentCandle) > math.abs(sizePrevCandle)) ? true : false // We now have the core info to evaluate engulfing candles switch checkBearish true => // Check for bearish engulfing (green candle followed by a larger red candle) isGreenToRed = ((getCandleColorIndex(0) < 0) and (getCandleColorIndex(1) > 0)) ? true : false ret := (isCurrentLagerThanPrevious and isGreenToRed) ? true : false false => // Check for bullish engulfing (red candle followed by a larger green candle) isRedToGreen = ((getCandleColorIndex(0) > 0) and (getCandleColorIndex(1) < 0)) ? true : false ret := (isCurrentLagerThanPrevious and isRedToGreen) ? true : false => ret := false // This should be impossible to trigger... ret // // Helper functions that wraps the isEngulfing above... isBearishEngulfuing() => ret = isEngulfing(true) ret // isBullishEngulfuing() => ret = isEngulfing(false) ret // // Functions to check for 3 consecutive candles of one color, followed by an engulfing candle of the opposite color // // Bearish 3LS = 3 green candles immediately followed by a bearish engulfing candle is3LSBear() => ret = false is3LineSetup = ((getCandleColorIndex(1) > 0) and (getCandleColorIndex(2) > 0) and (getCandleColorIndex(3) > 0)) ? true : false ret := (is3LineSetup and isBearishEngulfuing()) ? true : false ret // // Bullish 3LS = 3 red candles immediately followed by a bullish engulfing candle is3LSBull() => ret = false is3LineSetup = ((getCandleColorIndex(1) < 0) and (getCandleColorIndex(2) < 0) and (getCandleColorIndex(3) < 0)) ? true : false ret := (is3LineSetup and isBullishEngulfuing()) ? true : false ret // ### 3 Line Strike is3LSBearSig = is3LSBear() is3LSBullSig = is3LSBull() // Meme plots for the 3LS signal plotchar(showBull3LS and showMemeChars ? is3LSBullSig : na, char="🍆", color=color.rgb(0, 255, 0, 0), location=location.belowbar, size=size.tiny, text='3LS-Bull', title='3 Line Strike Up (Meme Icon)', editable=false) plotchar(showBear3LS and showMemeChars ? is3LSBearSig : na, char="🍑", color=color.rgb(255, 0, 0, 0), location=location.abovebar, size=size.tiny, text='3LS-Bear', title='3 Line Strike Down (Meme Icon)', editable=false) // // Standard plots for the 3LS signal plotshape(showBull3LS and not showMemeChars ? is3LSBullSig : na, style=shape.triangleup, color=color.rgb(0, 255, 0, 0), location=location.belowbar, size=size.small, text='3LS-Bull', title='3 Line Strike Up') plotshape(showBear3LS and not showMemeChars ? is3LSBearSig : na, style=shape.triangledown, color=color.rgb(255, 0, 0, 0), location=location.abovebar, size=size.small, text='3LS-Bear', title='3 Line Strike Down') // // buy1_on = input.bool(true,"Buy 1") buy1_1 = input.string("White Marubozu","",options = ["None","White Marubozu","Black Marubozu","Doji","Evening Star","Morning Star","Shooting Star","Hammer","Inverted Hammer","Bearish Harami","Bullish Harami","Bearish Engulfing","Bullish Engulfing","Piercing Line","Bullish Belt","Bullish Kicker","Bearish Kicker","Hanging Man","Dark Cloud Cover"] ) buy1_2 = input.string("None","",options = ["None","White Marubozu","Black Marubozu","Doji","Evening Star","Morning Star","Shooting Star","Hammer","Inverted Hammer","Bearish Harami","Bullish Harami","Bearish Engulfing","Bullish Engulfing","Piercing Line","Bullish Belt","Bullish Kicker","Bearish Kicker","Hanging Man","Dark Cloud Cover"] ) buy2_on = input.bool(true,"Buy 2") buy2_1 = input.string("White Marubozu","",options = ["None","White Marubozu","Black Marubozu","Doji","Evening Star","Morning Star","Shooting Star","Hammer","Inverted Hammer","Bearish Harami","Bullish Harami","Bearish Engulfing","Bullish Engulfing","Piercing Line","Bullish Belt","Bullish Kicker","Bearish Kicker","Hanging Man","Dark Cloud Cover"] ) buy2_2 = input.string("None","",options = ["None","White Marubozu","Black Marubozu","Doji","Evening Star","Morning Star","Shooting Star","Hammer","Inverted Hammer","Bearish Harami","Bullish Harami","Bearish Engulfing","Bullish Engulfing","Piercing Line","Bullish Belt","Bullish Kicker","Bearish Kicker","Hanging Man","Dark Cloud Cover"] ) buy3_on = input.bool(true,"Buy 3") buy3_1 = input.string("White Marubozu","",options = ["None","White Marubozu","Black Marubozu","Doji","Evening Star","Morning Star","Shooting Star","Hammer","Inverted Hammer","Bearish Harami","Bullish Harami","Bearish Engulfing","Bullish Engulfing","Piercing Line","Bullish Belt","Bullish Kicker","Bearish Kicker","Hanging Man","Dark Cloud Cover"] ) buy3_2 = input.string("None","",options = ["None","White Marubozu","Black Marubozu","Doji","Evening Star","Morning Star","Shooting Star","Hammer","Inverted Hammer","Bearish Harami","Bullish Harami","Bearish Engulfing","Bullish Engulfing","Piercing Line","Bullish Belt","Bullish Kicker","Bearish Kicker","Hanging Man","Dark Cloud Cover"] ) buy4_on = input.bool(true,"Buy 4") buy4_1 = input.string("White Marubozu","",options = ["None","White Marubozu","Black Marubozu","Doji","Evening Star","Morning Star","Shooting Star","Hammer","Inverted Hammer","Bearish Harami","Bullish Harami","Bearish Engulfing","Bullish Engulfing","Piercing Line","Bullish Belt","Bullish Kicker","Bearish Kicker","Hanging Man","Dark Cloud Cover"] ) buy4_2 = input.string("None","",options = ["None","White Marubozu","Black Marubozu","Doji","Evening Star","Morning Star","Shooting Star","Hammer","Inverted Hammer","Bearish Harami","Bullish Harami","Bearish Engulfing","Bullish Engulfing","Piercing Line","Bullish Belt","Bullish Kicker","Bearish Kicker","Hanging Man","Dark Cloud Cover"] ) buy5_on = input.bool(true,"Buy 5") buy5_1 = input.string("White Marubozu","",options = ["None","White Marubozu","Black Marubozu","Doji","Evening Star","Morning Star","Shooting Star","Hammer","Inverted Hammer","Bearish Harami","Bullish Harami","Bearish Engulfing","Bullish Engulfing","Piercing Line","Bullish Belt","Bullish Kicker","Bearish Kicker","Hanging Man","Dark Cloud Cover"] ) buy5_2 = input.string("None","",options = ["None","White Marubozu","Black Marubozu","Doji","Evening Star","Morning Star","Shooting Star","Hammer","Inverted Hammer","Bearish Harami","Bullish Harami","Bearish Engulfing","Bullish Engulfing","Piercing Line","Bullish Belt","Bullish Kicker","Bearish Kicker","Hanging Man","Dark Cloud Cover"] ) buy6_on = input.bool(true,"Buy 6") buy6_1 = input.string("White Marubozu","",options = ["None","White Marubozu","Black Marubozu","Doji","Evening Star","Morning Star","Shooting Star","Hammer","Inverted Hammer","Bearish Harami","Bullish Harami","Bearish Engulfing","Bullish Engulfing","Piercing Line","Bullish Belt","Bullish Kicker","Bearish Kicker","Hanging Man","Dark Cloud Cover"] ) buy6_2 = input.string("None","",options = ["None","White Marubozu","Black Marubozu","Doji","Evening Star","Morning Star","Shooting Star","Hammer","Inverted Hammer","Bearish Harami","Bullish Harami","Bearish Engulfing","Bullish Engulfing","Piercing Line","Bullish Belt","Bullish Kicker","Bearish Kicker","Hanging Man","Dark Cloud Cover"] ) buy7_on = input.bool(true,"Buy 7") buy7_1 = input.string("White Marubozu","",options = ["None","White Marubozu","Black Marubozu","Doji","Evening Star","Morning Star","Shooting Star","Hammer","Inverted Hammer","Bearish Harami","Bullish Harami","Bearish Engulfing","Bullish Engulfing","Piercing Line","Bullish Belt","Bullish Kicker","Bearish Kicker","Hanging Man","Dark Cloud Cover"] ) buy7_2 = input.string("None","",options = ["None","White Marubozu","Black Marubozu","Doji","Evening Star","Morning Star","Shooting Star","Hammer","Inverted Hammer","Bearish Harami","Bullish Harami","Bearish Engulfing","Bullish Engulfing","Piercing Line","Bullish Belt","Bullish Kicker","Bearish Kicker","Hanging Man","Dark Cloud Cover"] ) buy8_on = input.bool(true,"Buy 8") buy8_1 = input.string("White Marubozu","",options = ["None","White Marubozu","Black Marubozu","Doji","Evening Star","Morning Star","Shooting Star","Hammer","Inverted Hammer","Bearish Harami","Bullish Harami","Bearish Engulfing","Bullish Engulfing","Piercing Line","Bullish Belt","Bullish Kicker","Bearish Kicker","Hanging Man","Dark Cloud Cover"] ) buy8_2 = input.string("None","",options = ["None","White Marubozu","Black Marubozu","Doji","Evening Star","Morning Star","Shooting Star","Hammer","Inverted Hammer","Bearish Harami","Bullish Harami","Bearish Engulfing","Bullish Engulfing","Piercing Line","Bullish Belt","Bullish Kicker","Bearish Kicker","Hanging Man","Dark Cloud Cover"] ) buy9_on = input.bool(true,"Buy 9") buy9_1 = input.string("White Marubozu","",options = ["None","White Marubozu","Black Marubozu","Doji","Evening Star","Morning Star","Shooting Star","Hammer","Inverted Hammer","Bearish Harami","Bullish Harami","Bearish Engulfing","Bullish Engulfing","Piercing Line","Bullish Belt","Bullish Kicker","Bearish Kicker","Hanging Man","Dark Cloud Cover"] ) buy9_2 = input.string("None","",options = ["None","White Marubozu","Black Marubozu","Doji","Evening Star","Morning Star","Shooting Star","Hammer","Inverted Hammer","Bearish Harami","Bullish Harami","Bearish Engulfing","Bullish Engulfing","Piercing Line","Bullish Belt","Bullish Kicker","Bearish Kicker","Hanging Man","Dark Cloud Cover"] ) buy10_on = input.bool(true,"Buy 10") buy10_1 = input.string("White Marubozu","",options = ["None","White Marubozu","Black Marubozu","Doji","Evening Star","Morning Star","Shooting Star","Hammer","Inverted Hammer","Bearish Harami","Bullish Harami","Bearish Engulfing","Bullish Engulfing","Piercing Line","Bullish Belt","Bullish Kicker","Bearish Kicker","Hanging Man","Dark Cloud Cover"] ) buy10_2 = input.string("None","",options = ["None","White Marubozu","Black Marubozu","Doji","Evening Star","Morning Star","Shooting Star","Hammer","Inverted Hammer","Bearish Harami","Bullish Harami","Bearish Engulfing","Bullish Engulfing","Piercing Line","Bullish Belt","Bullish Kicker","Bearish Kicker","Hanging Man","Dark Cloud Cover"] ) buy11_on = input.bool(true,"Buy 11") buy11_1 = input.string("White Marubozu","",options = ["None","White Marubozu","Black Marubozu","Doji","Evening Star","Morning Star","Shooting Star","Hammer","Inverted Hammer","Bearish Harami","Bullish Harami","Bearish Engulfing","Bullish Engulfing","Piercing Line","Bullish Belt","Bullish Kicker","Bearish Kicker","Hanging Man","Dark Cloud Cover"] ) buy11_2 = input.string("None","",options = ["None","White Marubozu","Black Marubozu","Doji","Evening Star","Morning Star","Shooting Star","Hammer","Inverted Hammer","Bearish Harami","Bullish Harami","Bearish Engulfing","Bullish Engulfing","Piercing Line","Bullish Belt","Bullish Kicker","Bearish Kicker","Hanging Man","Dark Cloud Cover"] ) buy12_on = input.bool(true,"Buy 12") buy12_1 = input.string("White Marubozu","",options = ["None","White Marubozu","Black Marubozu","Doji","Evening Star","Morning Star","Shooting Star","Hammer","Inverted Hammer","Bearish Harami","Bullish Harami","Bearish Engulfing","Bullish Engulfing","Piercing Line","Bullish Belt","Bullish Kicker","Bearish Kicker","Hanging Man","Dark Cloud Cover"] ) buy12_2 = input.string("None","",options = ["None","White Marubozu","Black Marubozu","Doji","Evening Star","Morning Star","Shooting Star","Hammer","Inverted Hammer","Bearish Harami","Bullish Harami","Bearish Engulfing","Bullish Engulfing","Piercing Line","Bullish Belt","Bullish Kicker","Bearish Kicker","Hanging Man","Dark Cloud Cover"] ) buy13_on = input.bool(true,"Buy 13") buy13_1 = input.string("White Marubozu","",options = ["None","White Marubozu","Black Marubozu","Doji","Evening Star","Morning Star","Shooting Star","Hammer","Inverted Hammer","Bearish Harami","Bullish Harami","Bearish Engulfing","Bullish Engulfing","Piercing Line","Bullish Belt","Bullish Kicker","Bearish Kicker","Hanging Man","Dark Cloud Cover"] ) buy13_2 = input.string("None","",options = ["None","White Marubozu","Black Marubozu","Doji","Evening Star","Morning Star","Shooting Star","Hammer","Inverted Hammer","Bearish Harami","Bullish Harami","Bearish Engulfing","Bullish Engulfing","Piercing Line","Bullish Belt","Bullish Kicker","Bearish Kicker","Hanging Man","Dark Cloud Cover"] ) buy14_on = input.bool(true,"Buy 14") buy14_1 = input.string("White Marubozu","",options = ["None","White Marubozu","Black Marubozu","Doji","Evening Star","Morning Star","Shooting Star","Hammer","Inverted Hammer","Bearish Harami","Bullish Harami","Bearish Engulfing","Bullish Engulfing","Piercing Line","Bullish Belt","Bullish Kicker","Bearish Kicker","Hanging Man","Dark Cloud Cover"] ) buy14_2 = input.string("None","",options = ["None","White Marubozu","Black Marubozu","Doji","Evening Star","Morning Star","Shooting Star","Hammer","Inverted Hammer","Bearish Harami","Bullish Harami","Bearish Engulfing","Bullish Engulfing","Piercing Line","Bullish Belt","Bullish Kicker","Bearish Kicker","Hanging Man","Dark Cloud Cover"] ) buy15_on = input.bool(true,"Buy 15") buy15_1 = input.string("White Marubozu","",options = ["None","White Marubozu","Black Marubozu","Doji","Evening Star","Morning Star","Shooting Star","Hammer","Inverted Hammer","Bearish Harami","Bullish Harami","Bearish Engulfing","Bullish Engulfing","Piercing Line","Bullish Belt","Bullish Kicker","Bearish Kicker","Hanging Man","Dark Cloud Cover"] ) buy15_2 = input.string("None","",options = ["None","White Marubozu","Black Marubozu","Doji","Evening Star","Morning Star","Shooting Star","Hammer","Inverted Hammer","Bearish Harami","Bullish Harami","Bearish Engulfing","Bullish Engulfing","Piercing Line","Bullish Belt","Bullish Kicker","Bearish Kicker","Hanging Man","Dark Cloud Cover"] ) cand_ok(buy1_1) => buy1_1=="White Marubozu" ?wm or C_MarubozuWhiteBullish: buy1_1=="Black Marubozu" ?bm or C_MarubozuBlackBearish: buy1_1=="Doji" ?data: buy1_1=="Evening Star" ?data2: buy1_1=="Morning Star" ?data3: buy1_1=="Shooting Star" ?data4: buy1_1=="Hammer" ?data5: buy1_1=="Inverted Hammer" ?data5b: buy1_1=="Bearish Harami" ?data6: buy1_1=="Bullish Harami" ?data7: buy1_1=="Bearish Engulfing"?data8: buy1_1=="Bullish Engulfing"?data9: buy1_1=="Piercing Line" ?data10: buy1_1=="Bullish Belt" ?data11: buy1_1=="Bullish Kicker" ?data12: buy1_1=="Bearish Kicker" ?data13: buy1_1=="Hanging Man" ?data14: buy1_1=="Dark Cloud Cover" ?data15: true any = wm or bm or data or data2 or data3 or data4 or data5 or data5b or data6 or data7 or data8 or data9 or data10 or data11 or data12 or data13 or data14 or data15 htf_tr() => var int trend = 0 if C_MarubozuWhiteBullish or wm trend := 1 if C_MarubozuBlackBearish or bm trend := -1 var float stop_line = 0 if C_MarubozuWhiteBullish or wm stop_line :=low if C_MarubozuBlackBearish or bm stop_line := high f_trend = stop_line [f_trend[1],f_trend,trend[1],trend] // -- htf 1 -- // [line_1,line_,trend_1,trend_]= request.security(syminfo.tickerid,htf1_mb_tf,htf_tr(),barmerge.gaps_off,barmerge.lookahead_on) f_line1 = htf1_mb_tf==""or htf1_mb_tf==timeframe.period?line_ : line_1 f_trend1 = htf1_mb_tf==""or htf1_mb_tf==timeframe.period?trend_ : trend_1 var int htf_1_tr = 0 if f_trend1==-1 and ta.change(f_line1) htf_1_tr := -1 if f_trend1==1 and ta.change(f_line1) htf_1_tr := 1 // if htf_1_tr==1 and (lowf_line1 ) // htf_1_tr := 0 // -- htf 2 -- // [line_12,line_2,trend_12,trend_2]= request.security(syminfo.tickerid,htf2_mb_tf,htf_tr(),barmerge.gaps_off,barmerge.lookahead_on) f_line12 = htf2_mb_tf==""or htf2_mb_tf==timeframe.period?line_2 : line_12 f_trend12 = htf2_mb_tf==""or htf2_mb_tf==timeframe.period?trend_2 : trend_12 var int htf_2_tr = 0 if f_trend12==-1 and ta.change(f_line12) htf_2_tr := -1 if f_trend12==1 and ta.change(f_line12) htf_2_tr := 1 // if htf_2_tr==1 and (lowf_line12 ) // htf_2_tr := 0 // -- htf 3 -- // [line_13,line_3,trend_13,trend_3]= request.security(syminfo.tickerid,htf3_mb_tf,htf_tr(),barmerge.gaps_off,barmerge.lookahead_on) f_line13 = htf3_mb_tf==""or htf3_mb_tf==timeframe.period?line_3 : line_13 f_trend13 = htf3_mb_tf==""or htf3_mb_tf==timeframe.period?trend_3 : trend_13 var int htf_3_tr = 0 if f_trend13==-1 and ta.change(f_line13) htf_3_tr := -1 if f_trend13==1 and ta.change(f_line13) htf_3_tr := 1 // if htf_3_tr==1 and (lowf_line13 ) // htf_3_tr := 0 // -- htf 4 -- // [line_14,line_4,trend_14,trend_4]= request.security(syminfo.tickerid,htf4_mb_tf,htf_tr(),barmerge.gaps_off,barmerge.lookahead_on) f_line14 = htf4_mb_tf==""or htf4_mb_tf==timeframe.period?line_4 : line_14 f_trend14 = htf4_mb_tf==""or htf4_mb_tf==timeframe.period?trend_4 : trend_14 var int htf_4_tr = 0 if f_trend14==-1 and ta.change(f_line14) htf_4_tr := -1 if f_trend14==1 and ta.change(f_line14) htf_4_tr := 1 // if htf_4_tr==1 and (lowf_line14) // htf_4_tr := 0 f_htf_b = (htf1_mb_on or htf2_mb_on or htf3_mb_on or htf4_mb_on) ? (htf1_mb_on?htf_1_tr==1 and close>f_line1:false)or (htf2_mb_on?htf_2_tr==1 and close>f_line12:false)or (htf3_mb_on?htf_3_tr==1 and close>f_line13:false)or (htf4_mb_on?htf_4_tr==1 and close>f_line14:false) :false f_htf_s = (htf1_mb_on or htf2_mb_on or htf3_mb_on or htf4_mb_on) ? (htf1_mb_on?htf_1_tr==-1 and close=0 and rmi_s and f_htf_s // -- sell2 f_sell2_ = sell2_2!="None"?(cand_ok(sell2_1))[1] and cand_ok(sell2_2) : cand_ok(sell2_1) f_s2 = f_sell2_ and sell2_on and sps>=0 and rmi_s and f_htf_s // -- sell3 f_sell3_ = sell3_2!="None"?(cand_ok(sell3_1))[1] and cand_ok(sell3_2) : cand_ok(sell3_1) f_s3 = f_sell3_ and sell3_on and sps>=0 and rmi_s and f_htf_s // -- sell4 f_sell4_ = sell4_2!="None"?(cand_ok(sell4_1))[1] and cand_ok(sell4_2) : cand_ok(sell4_1) f_s4 = f_sell4_ and sell4_on and sps>=0 and rmi_s and f_htf_s // -- sell5 f_sell5_ = sell5_2!="None"?(cand_ok(sell5_1))[1] and cand_ok(sell5_2) : cand_ok(sell5_1) f_s5 = f_sell5_ and sell5_on and sps>=0 and rmi_s and f_htf_s // -- sell6 f_sell6_ = sell6_2!="None"?(cand_ok(sell6_1))[1] and cand_ok(sell6_2) : cand_ok(sell6_1) f_s6 = f_sell6_ and sell6_on and sps>=0 and rmi_s and f_htf_s // -- sell7 f_sell7_ = sell7_2!="None"?(cand_ok(sell7_1))[1] and cand_ok(sell7_2) : cand_ok(sell7_1) f_s7 = f_sell7_ and sell7_on and sps>=0 and rmi_s and f_htf_s // -- sell8 f_sell8_ = sell8_2!="None"?(cand_ok(sell8_1))[1] and cand_ok(sell8_2) : cand_ok(sell8_1) f_s8 = f_sell8_ and sell8_on and sps>=0 and rmi_s and f_htf_s // -- sell9 f_sell9_ = sell9_2!="None"?(cand_ok(sell9_1))[1] and cand_ok(sell9_2) : cand_ok(sell9_1) f_s9 = f_sell9_ and sell9_on and sps>=0 and rmi_s and f_htf_s // -- sell10 f_sell10_ = sell10_2!="None"?(cand_ok(sell10_1))[1] and cand_ok(sell10_2) : cand_ok(sell10_1) f_s10 = f_sell10_ and sell10_on and sps>=0 and rmi_s and f_htf_s // -- sell11 f_sell11_ = sell11_2!="None"?(cand_ok(sell11_1))[1] and cand_ok(sell11_2) : cand_ok(sell11_1) f_s11 = f_sell11_ and sell11_on and sps>=0 and rmi_s and f_htf_s // -- sell12 f_sell12_ = sell12_2!="None"?(cand_ok(sell12_1))[1] and cand_ok(sell12_2) : cand_ok(sell12_1) f_s12 = f_sell12_ and sell12_on and sps>=0 and rmi_s and f_htf_s // -- sell13 f_sell13_ = sell13_2!="None"?(cand_ok(sell13_1))[1] and cand_ok(sell13_2) : cand_ok(sell13_1) f_s13 = f_sell13_ and sell13_on and sps>=0 and rmi_s and f_htf_s // -- sell14 f_sell14_ = sell14_2!="None"?(cand_ok(sell14_1))[1] and cand_ok(sell14_2) : cand_ok(sell14_1) f_s14 = f_sell14_ and sell14_on and sps>=0 and rmi_s and f_htf_s // -- sell15 f_sell15_ = sell15_2!="None"?(cand_ok(sell15_1))[1] and cand_ok(sell15_2) : cand_ok(sell15_1) f_s15 = f_sell15_ and sell15_on and sps>=0 and rmi_s and f_htf_s str_s_on = input.bool(false,"Sell 16 - 3 Line Strike Down") f_s16 = str_s_on and is3LSBearSig and sps>=0 and rmi_s and f_htf_s slon = input.bool(true,"Stop Loss",inline = "sl") buff = input.float(0,"Buffer(Pips)",inline = "sl")*Pips() be_on = input.bool(true,"",inline = "be") be = input.float(1,"Breakeven R:R",inline = "be") tp_on = input.bool(true,"",inline = "tp") rr = input.float(2,"Take Profit R:R",inline = "tp") tslon = input.bool(true,"", inline="tsl") longTrailPerc = input.float(100,"Trailing SL (Pips)",inline="tsl" )*Pips() tsl_ty = input.string("Blank","",options = ["Blank","Breakeven"],inline="tsl") shortTrailPerc =longTrailPerc tzon = input.bool(true,"",group = "Trading Time Zone",inline="tx") tz = input.string("GMT+1","Use Different Time Zone",group = "Trading Time Zone",inline="tx") // -- tr_24_7 = input.bool(true,"Trade 24/7", group='Trading Days/Time' ) mon = input.bool(true, title='Mon', group='Trading Days/Time',inline = "mon" ) mon_24 = input.bool(true,"24hrs", group='Trading Days/Time',inline = "mon" ) mon_sess =mon_24?"0000-0000" : input.session("0000-1515",title="", group='Trading Days/Time',inline = "mon") tue = input.bool(true, title='Tue', group='Trading Days/Time',inline = "tue" ) tue_24 = input.bool(true,"24hrs", group='Trading Days/Time',inline = "tue" ) tue_sess =tue_24?"0000-0000" : input.session("0000-1515",title="", group='Trading Days/Time',inline = "tue") wed = input.bool(true, title='Wed', group='Trading Days/Time',inline = "wed" ) wed_24 = input.bool(true,"24hrs", group='Trading Days/Time',inline = "wed" ) wed_sess =wed_24?"0000-0000" : input.session("0000-1515",title="", group='Trading Days/Time',inline = "wed") thu = input.bool(true, title='Thur', group='Trading Days/Time',inline = "thu" ) thu_24 = input.bool(true,"24hrs", group='Trading Days/Time',inline = "thu" ) thu_sess =thu_24?"0000-0000" : input.session("0000-1515",title="", group='Trading Days/Time',inline = "thu") fri = input.bool(true, title='Fri', group='Trading Days/Time',inline = "fri" ) fri_24 = input.bool(true,"24hrs", group='Trading Days/Time',inline = "fri" ) fri_sess =fri_24?"0000-0000" : input.session("0000-1515",title="", group='Trading Days/Time',inline = "fri") sat = input.bool(true, title='Sat', group='Trading Days/Time',inline = "sat" ) sat_24 = input.bool(true,"24hrs", group='Trading Days/Time',inline = "sat" ) sat_sess =sat_24?"0000-0000" : input.session("0000-1515",title="", group='Trading Days/Time',inline = "sat") sun = input.bool(true, title='Sun', group='Trading Days/Time',inline = "sun" ) sun_24 = input.bool(true,"24hrs", group='Trading Days/Time',inline = "sun" ) sun_sess =sun_24?"0000-0000" : input.session("0000-1515",title="", group='Trading Days/Time',inline = "sun") //SESSION mon_ok = mon_sess + ':1' mon_ = (tzon? time(timeframe.period, mon_ok,tz ):time(timeframe.period, mon_ok)) in_mon = not(na(mon_)) and mon tue_ok = tue_sess + ':2' tue_ = (tzon? time(timeframe.period, tue_ok,tz ):time(timeframe.period, tue_ok)) in_tue = not(na(tue_)) and tue wed_ok = wed_sess + ':3' wed_ = (tzon? time(timeframe.period, wed_ok,tz ):time(timeframe.period, wed_ok)) in_wed = not(na(wed_)) and wed thu_ok = thu_sess + ':4' thu_ = (tzon? time(timeframe.period, thu_ok,tz ):time(timeframe.period, thu_ok)) in_thu = not(na(thu_)) and thu fri_ok = fri_sess + ':5' fri_ = (tzon? time(timeframe.period, fri_ok,tz ):time(timeframe.period, fri_ok)) in_fri = not(na(fri_)) and fri sat_ok = sat_sess + ':6' sat_ = (tzon? time(timeframe.period, sat_ok,tz ):time(timeframe.period, sat_ok)) in_sat = not(na(sat_)) and sat sun_ok = sun_sess + ':7' sun_ = (tzon? time(timeframe.period, sun_ok,tz ):time(timeframe.period, sun_ok)) in_sun = not(na(sun_)) and sun tr_days = tr_24_7?true: in_mon or in_tue or in_wed or in_thu or in_fri or in_sat or in_sun var float l_sl = 0 var float l_be = 0 var float l_tp = 0 var float l_ep = 0 var int tsl_l = 0 f_b = (f_b1 or f_b2 or f_b3 or f_b4 or f_b5 or f_b6 or f_b7 or f_b8 or f_b9 or f_b10 or f_b11 or f_b12 or f_b13 or f_b14 or f_b15 or f_b16 ) and sps<=0 and tr_days if f_b1 and sps<=0 and tr_days strategy.entry("Buy 1",strategy.long ) if f_b2 and sps<=0 and tr_days strategy.entry("Buy 2",strategy.long ) if f_b3 and sps<=0 and tr_days strategy.entry("Buy 3",strategy.long ) if f_b4 and sps<=0 and tr_days strategy.entry("Buy 4",strategy.long ) if f_b5 and sps<=0 and tr_days strategy.entry("Buy 5",strategy.long ) if f_b6 and sps<=0 and tr_days strategy.entry("Buy 6",strategy.long ) if f_b7 and sps<=0 and tr_days strategy.entry("Buy 7",strategy.long ) if f_b8 and sps<=0 and tr_days strategy.entry("Buy 8",strategy.long ) if f_b9 and sps<=0 and tr_days strategy.entry("Buy 9",strategy.long ) if f_b10 and sps<=0 and tr_days strategy.entry("Buy 10",strategy.long ) if f_b11 and sps<=0 and tr_days strategy.entry("Buy 11",strategy.long ) if f_b12 and sps<=0 and tr_days strategy.entry("Buy 12",strategy.long ) if f_b13 and sps<=0 and tr_days strategy.entry("Buy 13",strategy.long ) if f_b14 and sps<=0 and tr_days strategy.entry("Buy 14",strategy.long ) if f_b15 and sps<=0 and tr_days strategy.entry("Buy 15",strategy.long ) if f_b16 and sps<=0 and tr_days strategy.entry("Buy 16",strategy.long ) if f_b tsl_l := 0 l_ep := close l_sl := low - buff l_tp := l_ep + rr*(l_ep-l_sl) l_be := l_ep + be*(l_ep-l_sl) if sps>0 and high>l_be and be_on l_sl := l_ep tsl_l := 1 // Determine trail stop loss prices longStopPrice = 0.0 longStopPrice := if strategy.position_size > 0 and (tsl_ty=="Blank"?true:tsl_l==1)and tslon stopValue = close - longTrailPerc math.max(stopValue, longStopPrice[1]) else 0 f_sl_l = math.max(longStopPrice,l_sl) strategy.exit("Ex Buy 1","Buy 1",stop =slon?f_sl_l:na ,limit = tp_on?l_tp:na ) strategy.exit("Ex Buy 2","Buy 2",stop =slon?f_sl_l:na ,limit = tp_on?l_tp:na ) strategy.exit("Ex Buy 3","Buy 3",stop =slon?f_sl_l:na ,limit = tp_on?l_tp:na ) strategy.exit("Ex Buy 4","Buy 4",stop =slon?f_sl_l:na ,limit = tp_on?l_tp:na ) strategy.exit("Ex Buy 5","Buy 5",stop =slon?f_sl_l:na ,limit = tp_on?l_tp:na ) strategy.exit("Ex Buy 6","Buy 6",stop =slon?f_sl_l:na ,limit = tp_on?l_tp:na ) strategy.exit("Ex Buy 7","Buy 7",stop =slon?f_sl_l:na ,limit = tp_on?l_tp:na ) strategy.exit("Ex Buy 8","Buy 8",stop =slon?f_sl_l:na ,limit = tp_on?l_tp:na ) strategy.exit("Ex Buy 9","Buy 9",stop =slon?f_sl_l:na ,limit = tp_on?l_tp:na ) strategy.exit("Ex Buy 10","Buy 10",stop =slon?f_sl_l:na ,limit = tp_on?l_tp:na ) strategy.exit("Ex Buy 11","Buy 11",stop =slon?f_sl_l:na ,limit = tp_on?l_tp:na ) strategy.exit("Ex Buy 12","Buy 12",stop =slon?f_sl_l:na ,limit = tp_on?l_tp:na ) strategy.exit("Ex Buy 13","Buy 13",stop =slon?f_sl_l:na ,limit = tp_on?l_tp:na ) strategy.exit("Ex Buy 14","Buy 14",stop =slon?f_sl_l:na ,limit = tp_on?l_tp:na ) strategy.exit("Ex Buy 15","Buy 15",stop =slon?f_sl_l:na ,limit = tp_on?l_tp:na ) strategy.exit("Ex Buy 16","Buy 16",stop =slon?f_sl_l:na ,limit = tp_on?l_tp:na ) var float s_sl = 0 var float s_be = 0 var float s_tp = 0 var float s_ep = 0 var int tsl_s = 0 f_s = (f_s1 or f_s2 or f_s3 or f_s4 or f_s5 or f_s6 or f_s7 or f_s8 or f_s9 or f_s10 or f_s11 or f_s12 or f_s13 or f_s14 or f_s15 or f_s16 ) and sps>=0 and tr_days if f_s1 and sps>=0 and tr_days strategy.entry("Sell 1",strategy.short ) if f_s2 and sps>=0 and tr_days strategy.entry("Sell 2",strategy.short ) if f_s3 and sps>=0 and tr_days strategy.entry("Sell 3",strategy.short ) if f_s4 and sps>=0 and tr_days strategy.entry("Sell 4",strategy.short ) if f_s5 and sps>=0 and tr_days strategy.entry("Sell 5",strategy.short ) if f_s6 and sps>=0 and tr_days strategy.entry("Sell 6",strategy.short ) if f_s7 and sps>=0 and tr_days strategy.entry("Sell 7",strategy.short ) if f_s8 and sps>=0 and tr_days strategy.entry("Sell 8",strategy.short ) if f_s9 and sps>=0 and tr_days strategy.entry("Sell 9",strategy.short ) if f_s10 and sps>=0 and tr_days strategy.entry("Sell 10",strategy.short ) if f_s11 and sps>=0 and tr_days strategy.entry("Sell 11",strategy.short ) if f_s12 and sps>=0 and tr_days strategy.entry("Sell 12",strategy.short ) if f_s13 and sps>=0 and tr_days strategy.entry("Sell 13",strategy.short ) if f_s14 and sps>=0 and tr_days strategy.entry("Sell 14",strategy.short ) if f_s15 and sps>=0 and tr_days strategy.entry("Sell 15",strategy.short ) if f_s16 and sps>=0 and tr_days strategy.entry("Sell 16",strategy.short ) if f_s tsl_s := 0 s_ep := close s_sl := high + buff s_tp := s_ep - rr*(s_sl-s_ep) s_be := s_ep - be*(s_sl-s_ep) if sps<0 and low0 and tp_on ? l_tp : na , title='Long TP', color=color.new(color.orange, 0), linewidth=2, style=plot.style_linebr ) plot(sps>0 and slon ? f_sl_l : na , title='Long SL', color=color.new(color.maroon, 0), linewidth=2, style=plot.style_linebr ) show_be = input.bool(false,"Show Breakeven") show_tsl = input.bool(false,"Show Trailing SL") plot(sps>0 and show_be ? l_be : na , title='Long BE', color=color.new(color.yellow, 0), linewidth=2, style=plot.style_linebr ) plot(sps<0 and show_be ? s_be : na , title='Short BE', color=color.new(color.yellow, 0), linewidth=2, style=plot.style_linebr ) plot(sps>0 and show_tsl ? longStopPrice : na , title='Long TSL', color=color.new(color.purple, 0), linewidth=2, style=plot.style_linebr ) plot(sps<0 and show_tsl ? shortStopPrice : na , title='Short TSL', color=color.new(color.purple, 0), linewidth=2, style=plot.style_linebr ) // (1)Add a selectable option to show breakeven and trailing SL on the chart // (2)For the Trading Days under Input, when "Trading 24/7" is checked, the daily option should be unchecked, // and vice versa. Likewise, if the "24hrs" checkbox in front of the days is checked, the the time boxes in // front of the days should be locked. And, vice versa. See attached. // (3)There are no SL for some of the signals, I see it most on short signals. See attached screenshot // (4) The "3 Line Buy/Sell shouldn't be included in the drop down list since it's a standalone signal // on it's own. It should be label as Buy 5 - 3 Line Strike Up/Sell 5 - 3 Line Strike Down // (4) No signal was generated, no trade was taken when I selected patterns combination e.g. I checked Buy 1 and // selected "Bearish Engulfing", followed by "Bullish Engulfing" as criteria for my Buy 1 signal but it didn't work. // See attached for example. The same thing for all the candle patterns, any defined selection should generate a signal and trade. // It could be selection of a single pattern or up to 4 patterns selected in order.