buy1 = hma17 > level1 and hma17[1] < level1[1] and close > close[2] buy2 = hma17 > level2 and hma17[1] < level2[1] and close > close[2] buy3 = hma17 > level3 and hma17[1] < level3[1] and close > close[2] buy4 = hma17 > level4 and hma17[1] < level4[1] and close > close[2] buy5 = hma17 > level5 and hma17[1] < level5[1] and close > close[2] buy6 = hma17 > level6 and hma17[1] < level6[1] and close > close[2] buy7 = hma17 > level7 and hma17[1] < level7[1] and close > close[2] buy8 = hma17 > level8 and hma17[1] < level8[1] and close > close[2]
sell1 = hma17 < level1 and hma17[1] > level1[1] and close < close[2] sell2 = hma17 < level2 and hma17[1] > level2[1] and close < close[2] sell3 = hma17 < level3 and hma17[1] > level3[1] and close < close[2] sell4 = hma17 < level4 and hma17[1] > level4[1] and close < close[2] sell5 = hma17 < level5 and hma17[1] > level5[1] and close < close[2] sell6 = hma17 < level6 and hma17[1] > level6[1] and close < close[2] sell7 = hma17 < level7 and hma17[1] > level7[1] and close < close[2] sell8 = hma17 < level8 and hma17[1] > level8[1] and close < close[2]
// Price: Higher Low priceHL18 = low[lbR18] > ta.valuewhen(plFound18, low[lbR18], 1) hiddenBullCond18 = plotHiddenBull18 and priceHL18 and oscLL18 and plFound18 //plot(plFound18 ? obv_osc[lbR18] : na,offset=-lbR18,title="Hidden Bullish",linewidth=2,color=(hiddenBullCond18 ? hiddenBullColor18 : noneColor18)) //plotshape(hiddenBullCond18 ? obv_osc[lbR18] : na,offset=-lbR18,title="Hidden Bullish Label",text=" H Bull ",style=shape.labelup,location=location.absolute,color=bullColor18,textcolor=textColor18)
// Regular Bearish
// Osc: Lower High oscLH18 = obv_osc[lbR18] < ta.valuewhen(phFound18, obv_osc[lbR18], 1) and _inRange(phFound18[1])
// Price: Higher High priceHH18 = high[lbR18] > ta.valuewhen(phFound18, high[lbR18], 1) bearCond18 = plotBear18 and priceHH18 and oscLH18 and phFound18 //plot(phFound18 ? obv_osc[lbR18] : na,offset=-lbR18,title="Regular Bearish",linewidth=2,color=(bearCond18 ? bearColor18 : noneColor18)) //plotshape(bearCond18 ? obv_osc[lbR18] : na,offset=-lbR18,title="Regular Bearish Label",text=" Bear ",style=shape.labeldown,location=location.absolute,color=bearColor18,textcolor=textColor18)
// Hidden Bearish
// Osc: Higher High oscHH18 = obv_osc[lbR18] > ta.valuewhen(phFound18, obv_osc[lbR18], 1) and _inRange(phFound18[1])
// Price: Lower High priceLH18 = high[lbR18] < ta.valuewhen(phFound18, high[lbR18], 1) hiddenBearCond18 = plotHiddenBear18 and priceLH18 and oscHH18 and phFound18 //plot(phFound18 ? obv_osc[lbR18] : na,offset=-lbR18,title="Hidden Bearish",linewidth=2,color=(hiddenBearCond18 ? hiddenBearColor18 : noneColor18)) //plotshape(hiddenBearCond18 ? obv_osc[lbR18] : na,offset=-lbR18,title="Hidden Bearish Label",text=" H Bear ",style=shape.labeldown,location=location.absolute,color=bearColor18,textcolor=textColor18)
//Chaikin Money Flow//////////////////////////////////////////////////////////// length19 = 50 ad19 = close == high and close == low or high == low ? 0 : (2 * close - low - high) / (high - low) * volume cmf = math.sum(ad19, length19) / math.sum(volume, length19) //plot(cmf, color=#43A047, title="MF") //hline(0, color=#787B86, title="Zero", linestyle=hline.style_dashed)
//VWAP////////////////////////////////////////////////////////////////////////// computeVWAP(src20, isNewPeriod, stDevMultiplier) => var float sumSrcVol = na var float sumVol = na var float sumSrcSrcVol = na
sumSrcVol := isNewPeriod ? src20 * volume : src20 * volume + sumSrcVol[1] sumVol := isNewPeriod ? volume : volume + sumVol[1] // sumSrcSrcVol calculates the dividend of the equation that is later used to calculate the standard deviation sumSrcSrcVol := isNewPeriod ? volume * math.pow(src20, 2) : volume * math.pow(src20, 2) + sumSrcSrcVol[1]
//Bullish Engulfing C_DownTrend = true C_UpTrend = true var trendRule1 = 'SMA50' var trendRule2 = 'SMA50, SMA200' var trendRule = trendRule1
if trendRule == trendRule1 priceAvg = ta.sma(close, 50) C_DownTrend := close < priceAvg C_UpTrend := close > priceAvg C_UpTrend
if trendRule == trendRule2 sma200 = ta.sma(close, 200) sma50 = ta.sma(close, 50) C_DownTrend := close < sma50 and sma50 < sma200 C_UpTrend := close > sma50 and sma50 > sma200 C_UpTrend C_Len = 14 // 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
label_color_bullish = color.blue C_EngulfingBullishNumberOfCandles = 2 C_EngulfingBullish = C_DownTrend and C_WhiteBody and C_LongBody and C_BlackBody[1] and C_SmallBody[1] and close >= open[1] and open <= close[1] and (close > open[1] or open < close[1]) if C_EngulfingBullish var ttBullishEngulfing = 'Engulfing\nAt the end of a given downward trend, there will most likely be a reversal pattern. To distinguish the first day, this candlestick pattern uses a small body, followed by a day where the candle body fully overtakes the body from the day before, and closes in the trend’s opposite direction. Although similar to the outside reversal chart pattern, it is not essential for this pattern to completely overtake the range (high to low), rather only the open and the close.' ttBullishEngulfing //label.new(bar_index, patternLabelPosLow, text="BE", style=label.style_label_up, color = label_color_bullish, textcolor=color.white, tooltip = ttBullishEngulfing) //bgcolor(highest(C_EngulfingBullish?1:0, C_EngulfingBullishNumberOfCandles)!=0 ? color.blue : na, offset=-(C_EngulfingBullishNumberOfCandles-1))
//Bearish Engulfing label_color_bearish = color.red C_EngulfingBearishNumberOfCandles = 2 C_EngulfingBearish = C_UpTrend and C_BlackBody and C_LongBody and C_WhiteBody[1] and C_SmallBody[1] and close <= open[1] and open >= close[1] and (close < open[1] or open > close[1]) if C_EngulfingBearish var ttBearishEngulfing = 'Engulfing\nAt the end of a given uptrend, a reversal pattern will most likely appear. During the first day, this candlestick pattern uses a small body. It is then followed by a day where the candle body fully overtakes the body from the day before it and closes in the trend’s opposite direction. Although similar to the outside reversal chart pattern, it is not essential for this pattern to fully overtake the range (high to low), rather only the open and the close.' ttBearishEngulfing //label.new(bar_index, patternLabelPosHigh, text="BE", style=label.style_label_down, color = label_color_bearish, textcolor=color.white, tooltip = ttBearishEngulfing) //bgcolor(highest(C_EngulfingBearish?1:0, C_EngulfingBearishNumberOfCandles)!=0 ? color.red : na, offset=-(C_EngulfingBearishNumberOfCandles-1))
macdcrosssignalimportance = input.int(defval=1, minval=0, maxval=100, title='MACD Cross Signal Importance') macdcrosssignalup = macd > signal and macd[1] < signal[1] and signal < 0 ? macdcrosssignalimportance : 0 macdcrosssignalupstatus = macdcrosssignalup ? 'MACD Crossed Signal Up' : na macdcrosssignaldown = macd < signal and macd[1] > signal[1] and signal > 0 ? macdcrosssignalimportance : 0 macdcrosssignaldownstatus = macdcrosssignaldown ? 'MACD Crossed Signal Down' : na
//WaveTrend Signals wtdivimportance = input.int(defval=0, minval=0, maxval=100, title='WaveTrend Divergence Importance') wtdivup = bullCond13 or bullCond13[1] or bullCond13[2] ? wtdivimportance : 0 wtdivupstatus = wtdivup ? 'Bullish WaveTrend Divergence' : na wtdivdown = bearCond13 or bearCond13[1] or bearCond13[2] ? wtdivimportance : 0 wtdivdownstatus = wtdivdown ? 'Bearish WaveTrend Divergence' : na
wtcrosssignalimportance = input.int(defval=4, minval=0, maxval=100, title='WaveTrend Cross Signal Importance') wtcrosssignalup = wt1 > wt2 and wt1[1] < wt2[1] and wt2 < -10 ? wtcrosssignalimportance : 0 wtcrosssignalupstatus = wtcrosssignalup ? 'WaveTrend Crossed Signal Up' : na wtcrosssignaldown = wt1 < wt2 and wt1[1] > wt2[1] and wt2 > 10 ? wtcrosssignalimportance : 0 wtcrosssignaldownstatus = wtcrosssignaldown ? 'WaveTrend Crossed Signal Down' : na
//Stochastic Signals sdivimportance = input.int(defval=1, minval=0, maxval=100, title='Stochastic Divergence Importance') sdivup = bullCond14 or bullCond14[1] or bullCond14[2] ? sdivimportance : 0 sdivupstatus = sdivup ? 'Bullish Stoch Divergence' : na sdivdown = bearCond14 or bearCond14[1] or bearCond14[2] ? sdivimportance : 0 sdivdownstatus = sdivdown ? 'Bearish Stoch Divergence' : na
scrosssignalimportance = input.int(defval=1, minval=0, maxval=100, title='Stoch Cross Signal Importance') scrosssignalup = k14 > d14 and k14[1] < d14[1] ? scrosssignalimportance : 0 scrosssignalupstatus = scrosssignalup ? 'Stoch Crossed Signal Up' : na scrosssignaldown = k14 < d14 and k14[1] > d14[1] ? scrosssignalimportance : 0 scrosssignaldownstatus = scrosssignaldown ? 'Stoch Crossed Signal Down' : na
//Relative Volatility Index Signals rviposimportance = input.int(defval=3, minval=0, maxval=100, title='RVI Position Importance') rviposup = rvi > 25 and rvi[1] < 40 ? rviposimportance : 0 rviposupstatus = rviposup ? 'RVI Volatility Increasing' : na rviposdown = rvi < 75 and rvi[1] > 60 ? rviposimportance : 0 rviposdownstatus = rviposdown ? 'RVI Volatility Decreasing' : na
rvidivimportance = input.int(defval=4, minval=0, maxval=100, title='RVI Divergence Importance') rvidivup = bullCond15 or bullCond15[1] or bullCond15[2] ? rvidivimportance : 0 rvidivupstatus = rvidivup ? 'Bullish RVI Divergence' : na rvidivdown = bearCond15 or bearCond15[1] or bearCond15[2] ? rvidivimportance : 0 rvidivdownstatus = rvidivdown ? 'Bearish RVI Divergence' : na
//Support and Resistance Signals srcrossimportance = input.int(defval=0, minval=0, maxval=100, title='Support/Resistance Cross Importance') srcrossup = buy1 or buy2 or buy3 or buy4 or buy5 or buy6 or buy7 or buy8 ? srcrossimportance : 0 srcrossupstatus = srcrossup ? 'Crossed Key Level Up' : na srcrossdown = sell1 or sell2 or sell3 or sell4 or sell5 or sell6 or sell7 or sell8 ? srcrossimportance : 0 srcrossdownstatus = srcrossdown ? 'Crossed Key Level Down' : na
//Bollinger Bands Status if bbcontup ? 1 : na table.cell(statuswindow, 1, 1, text=str.tostring(bbcontupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small) if bbcontup ? na : 1 table.clear(statuswindow, 1, 1) if bbcontup ? 1 : na table.cell(statuswindow, 1, 2, text=str.tostring(bbcontdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small) if bbcontdown ? na : 1 table.clear(statuswindow, 1, 2)
//ATR Status if atrrevup ? 1 : na table.cell(statuswindow, 1, 3, text=str.tostring(atrrevupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small) if atrrevup ? na : 1 table.clear(statuswindow, 1, 3) if atrrevdown ? 1 : na table.cell(statuswindow, 1, 4, text=str.tostring(atrrevdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small) if atrrevdown ? na : 1 table.clear(statuswindow, 1, 4)
//RVI Status if rviposup ? 1 : na table.cell(statuswindow, 1, 5, text=str.tostring(rviposupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small) if rviposup ? na : 1 table.clear(statuswindow, 1, 5) if rviposdown ? 1 : na table.cell(statuswindow, 1, 6, text=str.tostring(rviposdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small) if rviposdown ? na : 1 table.clear(statuswindow, 1, 6) if rvidivup ? 1 : na table.cell(statuswindow, 1, 7, text=str.tostring(rvidivupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small) if rvidivup ? na : 1 table.clear(statuswindow, 1, 7) if rvidivdown ? 1 : na table.cell(statuswindow, 1, 8, text=str.tostring(rvidivdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small) if rvidivdown ? na : 1 table.clear(statuswindow, 1, 8)
//Support and Resistance Status if srcrossup ? 1 : na table.cell(statuswindow, 1, 9, text=str.tostring(srcrossupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small) if srcrossup ? na : 1 table.clear(statuswindow, 1, 9) if srcrossdown ? 1 : na table.cell(statuswindow, 1, 10, text=str.tostring(srcrossdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small) if srcrossdown ? na : 1 table.clear(statuswindow, 1, 10)
//On Balance Volume Status if obvdivup ? 1 : na table.cell(statuswindow, 0, 1, text=str.tostring(obvdivupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small) if obvdivup ? na : 1 table.clear(statuswindow, 0, 1) if obvdivdown ? 1 : na table.cell(statuswindow, 0, 2, text=str.tostring(obvdivdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small) if obvdivdown ? na : 1 table.clear(statuswindow, 0, 2)
//Chaikin Money Flow Status if cmfcrossup ? 1 : na table.cell(statuswindow, 0, 3, text=str.tostring(cmfcrossupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small) if cmfcrossup ? na : 1 table.clear(statuswindow, 0, 3) if cmfcrossdown ? 1 : na table.cell(statuswindow, 0, 4, text=str.tostring(cmfcrossdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small) if cmfcrossdown ? na : 1 table.clear(statuswindow, 0, 4) if cmflevup ? 1 : na table.cell(statuswindow, 0, 5, text=str.tostring(cmflevupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small) if cmflevdown ? 1 : na table.cell(statuswindow, 0, 5, text=str.tostring(cmflevdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)
//VWAP Status if vwapcrossup ? 1 : na table.cell(statuswindow, 0, 6, text=str.tostring(vwapcrossupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small) if vwapcrossup ? na : 1 table.clear(statuswindow, 0, 6) if vwapcrossdown ? 1 : na table.cell(statuswindow, 0, 7, text=str.tostring(vwapcrossdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small) if vwapcrossdown ? na : 1 table.clear(statuswindow, 0, 7) if vwaptrendup ? 1 : na table.cell(statuswindow, 0, 8, text=str.tostring(vwaptrendupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small) if vwaptrenddown ? 1 : na table.cell(statuswindow, 0, 8, text=str.tostring(vwaptrenddownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)
//Candle Pattern Status if bulleng ? 1 : na table.cell(statuswindow, 0, 9, text=str.tostring(bullengstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small) if bulleng ? na : 1 table.clear(statuswindow, 0
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.