So before you get to excited - this is only the half of an idea which needs some Pine Scripting polish before I would classify this idea as one to take note of. With that said, if there's someone reading this that is willing to amend the code of my poor attempt to combine 3 scripts together in to 1 rather successful (potentially) algo/auto-trading script which was initially intended to place trades on MT5 for those who are either stuck, to far tied-in or simply stubborn enough to continue using a broker/s that are not listed on TradingView's list of verified brokers.
I must add that I honestly think this script has the potential to be one hellofa successful strategy for any trader who is considering or attempting to learn this fascinating and exciting coding language that can either leave you more confused than blind deaf old man at a psychedelic's rave OR open up a whole new approach of trading that was previously unfathomable yet now with each unique scripts encounter becoming unquestionably clearer that traders who embrace this path can only empower their trading potentials. I think if more opportunistic scripts like this one (once correctly coded by someone who is not as much a rookie as I am - at Pine Script coding not trading) along with some helpful guidelines for traders who have not discovered the wonders that TradingView has to offer any/all traders - that these "aha" types of doorways will be easily flooded with new interest evoked traders to the TradingView world.
But that's just one traders opinion who is looking towards putting this somewhat overly thought concept to test/s and I welcome any of you who wish to do the same, particularly in terms of trying to make heads or tails of my script that in theory makes perfect sense in my mind by using well known trading concepts by those who don't necessarily need to know how to code them in order to use them. However, in this specific case, the knowledge of how to code them has been given the centre front spotlight so feel free to take your shot in it's lime light if you wish. I would most definitely appreciate it and I'm sure you would benefit from the final scripts results as well.
Thanks to any and all who give it a go.
// Here's the script that I feel is best to share - there is a more recent updated version, however, I feel that my scripting skills or lack of may have made that version a great deal more confusing and messy than what this version below is. Hopefully you can see where Im trying to go with it. If not, please don't hesitate to ask and I'll do my best to try clarify where needed. //
//version=4 // // Thanks to dynausmaux falconCoin LazyBear RicardoSantos LucemAnb andreholanda73 for all the scripts I'm using here. // Special thanks to TradingView for unarguably the best trading platform in the world that facilitates development and learning. // Before I begin, TAKE NOTE: I'm not an expert trader or pine script coder as such and all the code used here is copied and/or modified from scripts freely found that are published through TradingView. // // // For those of you who actually do look in to the code behind scripts they come accross - here's logic behind all the colorful shapes all over your charts. // // CIRCLES & TRIANGLES: // - LITTLE CIRCLE: They appear at all WaveTrend wave crossings. // - GREEN CIRCLE: The wavetrend waves are at the oversold level and have crossed up (bullish). // - RED CIRCLE: The wavetrend waves are at the overbought level and have crossed down (bearish). // - GOLD/ORANGE CIRCLE: When RSI is below 20, WaveTrend waves are below or equal to -80 and have crossed up after good bullish divergence (DONT BUY WHEN GOLD CIRCLE APPEAR). // - None of these circles are certain signs to trade. It is only information that can help you. // - PURPLE TRIANGLE: Appear when a bullish or bearish divergence is formed and WaveTrend waves crosses at overbought and oversold points. // // +BEARS/BULLS FLAG: // - MFI+RSI Area are RED (Below 0). // - Wavetrend wave above 0 and crossing over down. // - VWAP Area below 0 on higher timeframe. // - This pattern reversed becomes bullish. // +SIDE NOTE: Check the last heikinashi candle from 2 higher timeframe // - Bearish/Bullish DIAMOND: // -- HT Candle is red // -- WT > 0 and crossed down
study(title = 'VuManChu B Divergences', shorttitle = 'VuMan CBD')
// PARAMETERS { // WaveTrend wtShow = input(true, title = 'Show WaveTrend', type = input.bool) wtBuyShow = input(true, title = 'Show Buy dots', type = input.bool) wtGoldShow = input(true, title = 'Show Gold dots', type = input.bool) wtSellShow = input(true, title = 'Show Sell dots', type = input.bool) wtDivShow = input(true, title = 'Show Div. dots', type = input.bool) vwapShow = input(true, title = 'Show Fast WT', type = input.bool) wtChannelLen = input(9, title = 'WT Channel Length', type = input.integer) wtAverageLen = input(12, title = 'WT Average Length', type = input.integer) wtMASource = input(hlc3, title = 'WT MA Source', type = input.source) wtMALen = input(3, title = 'WT MA Length', type = input.integer)
// WaveTrend Overbought & Oversold lines obLevel = input(53, title = 'WT Overbought Level 1', type = input.integer) obLevel2 = input(60, title = 'WT Overbought Level 2', type = input.integer) obLevel3 = input(100, title = 'WT Overbought Level 3', type = input.integer) osLevel = input(-53, title = 'WT Oversold Level 1', type = input.integer) osLevel2 = input(-60, title = 'WT Oversold Level 2', type = input.integer) osLevel3 = input(-75, title = 'WT Oversold Level 3', type = input.integer)
// Divergence WT wtShowDiv = input(true, title = 'Show WT Regular Divergences', type = input.bool) wtShowHiddenDiv = input(false, title = 'Show WT Hidden Divergences', type = input.bool) showHiddenDiv_nl = input(true, title = 'Not apply OB/OS Limits on Hidden Divergences', type = input.bool) wtDivOBLevel = input(45, title = 'WT Bearish Divergence min', type = input.integer) wtDivOSLevel = input(-65, title = 'WT Bullish Divergence min', type = input.integer)
// Divergence extra range wtDivOBLevel_addshow = input(true, title = 'Show 2nd WT Regular Divergences', type = input.bool) wtDivOBLevel_add = input(15, title = 'WT 2nd Bearish Divergence', type = input.integer) wtDivOSLevel_add = input(-40, title = 'WT 2nd Bullish Divergence 15 min', type = input.integer)
// RSI+MFI rsiMFIShow = input(true, title = 'Show MFI', type = input.bool) rsiMFIperiod = input(60,title = 'MFI Period', type = input.integer) rsiMFIMultiplier = input(150, title = 'MFI Area multiplier', type = input.float) rsiMFIPosY = input(2.5, title = 'MFI Area Y Pos', type = input.float)
// RSI rsiShow = input(false, title = 'Show RSI', type = input.bool) rsiSRC = input(close, title = 'RSI Source', type = input.source) rsiLen = input(14, title = 'RSI Length', type = input.integer) rsiOversold = input(30, title = 'RSI Oversold', minval = 50, maxval = 100, type = input.integer) rsiOverbought = input(60, title = 'RSI Overbought', minval = 0, maxval = 50, type = input.integer)
// Divergence RSI rsiShowDiv = input(false, title = 'Show RSI Regular Divergences', type = input.bool) rsiShowHiddenDiv = input(false, title = 'Show RSI Hidden Divergences', type = input.bool) rsiDivOBLevel = input(60, title = 'RSI Bearish Divergence min', type = input.integer) rsiDivOSLevel = input(30, title = 'RSI Bullish Divergence min', type = input.integer)
// RSI Stochastic stochShow = input(true, title = 'Show Stochastic RSI', type = input.bool) stochUseLog = input(true, title=' Use Log?', type = input.bool) stochAvg = input(false, title='Use Average of both K & D', type = input.bool) stochSRC = input(close, title = 'Stochastic RSI Source', type = input.source) stochLen = input(14, title = 'Stochastic RSI Length', type = input.integer) stochRsiLen = input(14, title = 'RSI Length ', type = input.integer) stochKSmooth = input(3, title = 'Stochastic RSI K Smooth', type = input.integer) stochDSmooth = input(3, title = 'Stochastic RSI D Smooth', type = input.integer)
// Divergence stoch stochShowDiv = input(false, title = 'Show Stoch Regular Divergences', type = input.bool) stochShowHiddenDiv = input(false, title = 'Show Stoch Hidden Divergences', type = input.bool)
bearPattern = rsimfi < soomiRSIMFIBearLevel and wt2 > soomiFlagWTBearLevel and wtCross and wtCrossDown and hwtVwap < sommiVwapBearLevel bullPattern = rsimfi > soomiRSIMFIBullLevel and wt2 < soomiFlagWTBullLevel and wtCross and wtCrossUp and hwtVwap > sommiVwapBullLevel [bearPattern, bullPattern, hwtVwap]
f_findSommiDiamond(tf, tf2, wt1, wt2, wtCross, wtCrossUp, wtCrossDown) => [candleBodyDir, newBar] = f_getTFCandle(tf) [candleBodyDir2, newBar2] = f_getTFCandle(tf2) bearPattern = wt2 >= soomiDiamondWTBearLevel and wtCross and wtCrossDown and not candleBodyDir and not candleBodyDir2 bullPattern = wt2 <= soomiDiamondWTBullLevel and wtCross and wtCrossUp and candleBodyDir and candleBodyDir2 [bearPattern, bullPattern]
wtBearDivHidden_ = showHiddenDiv_nl ? wtBearDivHidden_nl : wtBearDivHidden wtBullDivHidden_ = showHiddenDiv_nl ? wtBullDivHidden_nl : wtBullDivHidden wtBearDivColor = (wtShowDiv and wtBearDiv) or (wtShowHiddenDiv and wtBearDivHidden_) ? colorRed : na wtBullDivColor = (wtShowDiv and wtBullDiv) or (wtShowHiddenDiv and wtBullDivHidden_) ? colorGreen : na wtBearDivColor_add = (wtShowDiv and (wtDivOBLevel_addshow and wtBearDiv_add)) or (wtShowHiddenDiv and (wtDivOBLevel_addshow and wtBearDivHidden_add)) ? #9a0202 : na wtBullDivColor_add = (wtShowDiv and (wtDivOBLevel_addshow and wtBullDiv_add)) or (wtShowHiddenDiv and (wtDivOBLevel_addshow and wtBullDivHidden_add)) ? #1b5e20 : na
// RSI Divergences [rsiFractalTop, rsiFractalBot, rsiLow_prev, rsiBearDiv, rsiBullDiv, rsiBearDivHidden, rsiBullDivHidden] = f_findDivs(rsi, rsiDivOBLevel, rsiDivOSLevel, true) [rsiFractalTop_nl, rsiFractalBot_nl, rsiLow_prev_nl, rsiBearDiv_nl, rsiBullDiv_nl, rsiBearDivHidden_nl, rsiBullDivHidden_nl] = f_findDivs(rsi, 0, 0, false) rsiBearDivHidden_ = showHiddenDiv_nl ? rsiBearDivHidden_nl : rsiBearDivHidden rsiBullDivHidden_ = showHiddenDiv_nl ? rsiBullDivHidden_nl : rsiBullDivHidden rsiBearDivColor = (rsiShowDiv and rsiBearDiv) or (rsiShowHiddenDiv and rsiBearDivHidden_) ? colorRed : na rsiBullDivColor = (rsiShowDiv and rsiBullDiv) or (rsiShowHiddenDiv and rsiBullDivHidden_) ? colorGreen : na
// Stoch Divergences [stochFractalTop, stochFractalBot, stochLow_prev, stochBearDiv, stochBullDiv, stochBearDivHidden, stochBullDivHidden] = f_findDivs(stochK, 0, 0, false) stochBearDivColor = (stochShowDiv and stochBearDiv) or (stochShowHiddenDiv and stochBearDivHidden) ? colorRed : na stochBullDivColor = (stochShowDiv and stochBullDiv) or (stochShowHiddenDiv and stochBullDivHidden) ? colorGreen : na
// Buy signal. buySignal = wtCross and wtCrossUp and wtOversold buySignalDiv = (wtShowDiv and wtBullDiv) or (wtShowDiv and wtBullDiv_add) or (stochShowDiv and stochBullDiv) or (rsiShowDiv and rsiBullDiv) buySignalDiv_color = wtBullDiv ? colorGreen : wtBullDiv_add ? color.new(colorGreen, 60) : rsiShowDiv ? colorGreen : na
// Sell signal sellSignal = wtCross and wtCrossDown and wtOverbought sellSignalDiv = (wtShowDiv and wtBearDiv) or (wtShowDiv and wtBearDiv_add) or (stochShowDiv and stochBearDiv) or (rsiShowDiv and rsiBearDiv) sellSignalDiv_color = wtBearDiv ? colorRed : wtBearDiv_add ? color.new(colorRed, 60) : rsiBearDiv ? colorRed : na // Gold Buy lastRsi = valuewhen(wtFractalBot, rsi[2], 0)[2] wtGoldBuy = ((wtShowDiv and wtBullDiv) or (rsiShowDiv and rsiBullDiv)) and wtLow_prev <= osLevel3 and wt2 > osLevel3 and wtLow_prev - wt2 <= -5 and lastRsi < 30
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.