RicardoSantos

[RS]VDUB-TRENDMASTER IV V0

Dilihat 2184 kali
201
Request for vdubus:
concept:
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Ingin menggunakan skrip ini pada carta?
study(title="[RS]VDUB-TRENDMASTER IV V0", overlay=false)
//  ||-->   Concept vdubus, Code RicardoSantos. <-------------------------------------------------------------------------------------------------------||
//  ||--------------------------------------------------------------------------------------------------------------------------------------------------||
//  ||-->   Input:  <-----------------------------------------------------------------------------------------------------------------------------------||
//  ||--------------------------------------------------------------------------------------------------------------------------------------------------||
_Type = input(defval=0, minval=0, maxval=2, title='0: Crossover, 1: MACD, 2: STOCH')
_NOTE0 = input(false, title='0: SMA, 1: WMA, 2: EMA, 3: Kijun-Sen(Base), 4: Tenkan-Sen(Conversion), 5: Senkou Span A(Leading A), 6: Senkou Span B(Leading B).')
_A = input(defval=0, minval=0, maxval=6, title='Input A for Crossover:')
_B = input(defval=0, minval=0, maxval=6, title='Input B for Crossover:')
_SRC_A = input(close, type=source, title='Source For Series A:')
_SRC_B = input(close, type=source, title='Source For Series B:')
//  ||--------------------------------------------------------------------------------------------------------------------------------------------------||
//  ||-->   SMA, EMA, WMA Inputs:  <--------------------------------------------------------------------------------------------------------------------||
//  ||--------------------------------------------------------------------------------------------------------------------------------------------------||
_MA_A_Length = input(12, title='Moving Average A Length:')
_MA_B_Length = input(24, title='Moving Average B Length:')
//  ||--------------------------------------------------------------------------------------------------------------------------------------------------||
//  ||-->   Ichimoku cloud  <---------------------------------------------------------------------------------------------------------------------------||
//  ||--------------------------------------------------------------------------------------------------------------------------------------------------||
IC_A_conversionPeriods = input(34, title='Ichimoku Cloud A - Conversion Period:')
IC_A_basePeriods = input(26, title='Ichimoku Cloud A - Base Period:')
IC_A_laggingSpan2Periods = input(52, title='Ichimoku Cloud A - Lagging Span:')
IC_A_displacement = input(26, title='Ichimoku Cloud A - Displacement:')
IC_B_conversionPeriods = input(34, title='Ichimoku Cloud B - Conversion Period:')
IC_B_basePeriods = input(26, title='Ichimoku Cloud B - Base Period:')
IC_B_laggingSpan2Periods = input(52, title='Ichimoku Cloud B - Lagging Span:')
IC_B_displacement = input(26, title='Ichimoku Cloud B - Displacement:')
//  ||-->   Functions:  <-------------------------------------------------------------------------------------------------------------------------------||
donchian(len) => avg(lowest(len), highest(len))
leadLine1(_conversionPeriods, _basePeriods)=>
    _conversionLine = donchian(_conversionPeriods)
    _baseLine = donchian(_basePeriods)
    avg(_conversionLine, _baseLine)
//  ||--------------------------------------------------------------------------------------------------------------------------------------------------||
//  ||-->   MACD  <-------------------------------------------------------------------------------------------------------------------------------------||
//  ||--------------------------------------------------------------------------------------------------------------------------------------------------||
_MACD_K = input(21)
_MACD_D = input(34)
_MACD_I = 1
//  ||-->   Functions:  <-------------------------------------------------------------------------------------------------------------------------------||
_MACD_FAST()=>
    [_fast, _, _] = macd(_SRC_A, _MACD_K, _MACD_D, _MACD_I)
    _fast
_MACD_SLOW()=>
    [_, _slow, _] = macd(_SRC_B, _MACD_K, _MACD_D, _MACD_I)
    _slow
//  ||--------------------------------------------------------------------------------------------------------------------------------------------------||
//  ||-->   STOCH  <------------------------------------------------------------------------------------------------------------------------------------||
//  ||--------------------------------------------------------------------------------------------------------------------------------------------------||
_STOCH_Length = input(14)
_STOCH_K = input(2)
_STOCH_D = input(4)
//  ||--------------------------------------------------------------------------------------------------------------------------------------------------||
//  ||-->   Output:  <----------------------------------------------------------------------------------------------------------------------------------||
//  ||--------------------------------------------------------------------------------------------------------------------------------------------------||
CrossOverA = _Type == 0 and _A == 0 ? sma(_SRC_A, _MA_A_Length) :
        _Type == 0 and _A == 1 ? wma(_SRC_A, _MA_A_Length) :
        _Type == 0 and _A == 2 ? ema(_SRC_A, _MA_A_Length) :
        _Type == 0 and _A == 3 ? donchian(IC_A_basePeriods) :                            // Ichimoku Baseline
        _Type == 0 and _A == 4 ? donchian(IC_A_conversionPeriods) :                      // Ichimoku Conversion
        _Type == 0 and _A == 5 ? leadLine1(IC_A_conversionPeriods, IC_A_basePeriods) :   // Ichimoku leading A
        _Type == 0 and _A == 6 ? donchian(IC_A_laggingSpan2Periods) :                    // Ichimoku leading B
        _Type == 1 ? _MACD_FAST() :
        _Type == 2 ? sma(stoch(_SRC_A, high, low, _STOCH_Length), _STOCH_K) :
        na

CrossOverB = _Type == 0 and _B == 0 ? sma(_SRC_B, _MA_B_Length) :
        _Type == 0 and _B == 1 ? wma(_SRC_B, _MA_B_Length) :
        _Type == 0 and _B == 2 ? ema(_SRC_B, _MA_B_Length) :
        _Type == 0 and _B == 3 ? donchian(IC_B_basePeriods) :                            // Ichimoku Baseline
        _Type == 0 and _B == 4 ? donchian(IC_B_conversionPeriods) :                      // Ichimoku Conversion
        _Type == 0 and _B == 5 ? leadLine1(IC_B_conversionPeriods, IC_A_basePeriods) :   // Ichimoku leading A
        _Type == 0 and _B == 6 ? donchian(IC_B_laggingSpan2Periods) :                    // Ichimoku leading B
        _Type == 1 ? _MACD_SLOW() :
        _Type == 2 ? sma(stoch(_SRC_B, high, low, _STOCH_Length), _STOCH_D) :
        na

OutputSignal = CrossOverA >= CrossOverB ? 1 : 0
plot(OutputSignal>0?1:-1, title='Trend Master IV - Signal', style=columns, color=OutputSignal>0?gray:red, transp=25)

Komen

Could you discuss the intuition behind this?
Balas
@txnemo, system is all @vdubus concept, he is the best person to ask questions about it.
Balas
Hi , what is the best timeframe to run indicator on ?
Balas
Laman Utama Penyaring Saham Penyaring Forex Penyaring Kripto Kalendar Ekonomi Bagaimana ia berfungsi Ciri-ciri Carta Harga Rujuk rakan Peraturan Dalaman Pusat Bantuan Laman web dan Penyelesaian Broker Widget Penyelesaian Pencartaan Perpustakaan Pencartaan yang Ringan Blog & Berita Twitter
Profil Tetapan Profil Akaun dan Pengebilan Kawan-kawan yang dirujuk Coin Tiket Sokongan Saya Pusat Bantuan Mesej Peribadi Sembang Daftar Keluar