Re: MT4 Indicator requests and ideas

16101
dmnik wrote: Fri Jul 29, 2022 5:25 am
Despite the extreme long-windedness of the desription
the idea seems a valid one (and only implements in the subwindow what RplusT has been preaching all along).
Just for comparison's sake: it gives you basically the same entries that Beatlemania's new XU-Hybrid will give you but - as you can see - it is the simplest approach imaginable.
[If you don't trust your indicator(s), i. e. need a lot of confirmation, go for Beatle's visually overwhelming setup]
Of course, if you wanted to enhance this method: you could time your entries & exits on a smaller TF-RSI:
for example: you analyse on H1 (overall bias) and trade in the prevalent direction on M1, M5, M15.
What I am saying is: it would be good to have 2 RSI indicators in the subwindows: on for bias, the other (lower TF) for entries & exits.
Attachments


Moving AveragesRe: MT4 Indicator requests and ideas

16102
Dear Mr.Tools can tradingview's BBW indicator be converted to MT4 version.
I think this metric is really great. Even better if it can be used on MT4.
Gratitude

https://tw.tradingview.com/script/tqitS ... ercentile/
https://tw.tradingview.com/script/uOPkV ... ime-Frame/

Code: Select all

//@version=5
//
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// @author  = The_Caretaker
// © The_Caretaker
//
// Much respect to John A Bollinger the creator of Bollinger Bands® and Bollinger Band Width indicators.
// 
// Feel free to reuse or develop this script further, please drop me a note below if you find it useful.
//

indicator('Bollinger Band Width Percentile', 'BBWP', overlay=false, format=format.percent, precision=2, max_bars_back = 1000)

///////////////////////////////////////////////////////////////////////////////
// variable declarations

var c_prcntSpctrm1 = array.new_color(na)
if barstate.isfirst
    array.push ( c_prcntSpctrm1, #0000FF )
    array.push ( c_prcntSpctrm1, #000AFF ), array.push ( c_prcntSpctrm1, #0014FF ), array.push ( c_prcntSpctrm1, #001FFF ), array.push ( c_prcntSpctrm1, #0029FF ), array.push ( c_prcntSpctrm1, #0033FF ),
    array.push ( c_prcntSpctrm1, #003DFF ), array.push ( c_prcntSpctrm1, #0047FF ), array.push ( c_prcntSpctrm1, #0052FF ), array.push ( c_prcntSpctrm1, #005CFF ), array.push ( c_prcntSpctrm1, #0066FF ),
    array.push ( c_prcntSpctrm1, #0070FF ), array.push ( c_prcntSpctrm1, #007AFF ), array.push ( c_prcntSpctrm1, #0085FF ), array.push ( c_prcntSpctrm1, #008FFF ), array.push ( c_prcntSpctrm1, #0099FF ),
    array.push ( c_prcntSpctrm1, #00A3FF ), array.push ( c_prcntSpctrm1, #00ADFF ), array.push ( c_prcntSpctrm1, #00B8FF ), array.push ( c_prcntSpctrm1, #00C2FF ), array.push ( c_prcntSpctrm1, #00CCFF ),
    array.push ( c_prcntSpctrm1, #00D6FF ), array.push ( c_prcntSpctrm1, #00E0FF ), array.push ( c_prcntSpctrm1, #00EBFF ), array.push ( c_prcntSpctrm1, #00F5FF ), array.push ( c_prcntSpctrm1, #00FFFF ),
    array.push ( c_prcntSpctrm1, #00FFF5 ), array.push ( c_prcntSpctrm1, #00FFEB ), array.push ( c_prcntSpctrm1, #00FFE0 ), array.push ( c_prcntSpctrm1, #00FFD6 ), array.push ( c_prcntSpctrm1, #00FFCC ),
    array.push ( c_prcntSpctrm1, #00FFC2 ), array.push ( c_prcntSpctrm1, #00FFB8 ), array.push ( c_prcntSpctrm1, #00FFAD ), array.push ( c_prcntSpctrm1, #00FFA3 ), array.push ( c_prcntSpctrm1, #00FF99 ),
    array.push ( c_prcntSpctrm1, #00FF8F ), array.push ( c_prcntSpctrm1, #00FF85 ), array.push ( c_prcntSpctrm1, #00FF7A ), array.push ( c_prcntSpctrm1, #00FF70 ), array.push ( c_prcntSpctrm1, #00FF66 ),
    array.push ( c_prcntSpctrm1, #00FF5C ), array.push ( c_prcntSpctrm1, #00FF52 ), array.push ( c_prcntSpctrm1, #00FF47 ), array.push ( c_prcntSpctrm1, #00FF3D ), array.push ( c_prcntSpctrm1, #00FF33 ),
    array.push ( c_prcntSpctrm1, #00FF29 ), array.push ( c_prcntSpctrm1, #00FF1F ), array.push ( c_prcntSpctrm1, #00FF14 ), array.push ( c_prcntSpctrm1, #00FF0A ), array.push ( c_prcntSpctrm1, #00FF00 ),
    array.push ( c_prcntSpctrm1, #0AFF00 ), array.push ( c_prcntSpctrm1, #14FF00 ), array.push ( c_prcntSpctrm1, #1FFF00 ), array.push ( c_prcntSpctrm1, #29FF00 ), array.push ( c_prcntSpctrm1, #33FF00 ),
    array.push ( c_prcntSpctrm1, #3DFF00 ), array.push ( c_prcntSpctrm1, #47FF00 ), array.push ( c_prcntSpctrm1, #52FF00 ), array.push ( c_prcntSpctrm1, #5CFF00 ), array.push ( c_prcntSpctrm1, #66FF00 ),
    array.push ( c_prcntSpctrm1, #70FF00 ), array.push ( c_prcntSpctrm1, #7AFF00 ), array.push ( c_prcntSpctrm1, #85FF00 ), array.push ( c_prcntSpctrm1, #8FFF00 ), array.push ( c_prcntSpctrm1, #99FF00 ),
    array.push ( c_prcntSpctrm1, #A3FF00 ), array.push ( c_prcntSpctrm1, #ADFF00 ), array.push ( c_prcntSpctrm1, #B8FF00 ), array.push ( c_prcntSpctrm1, #C2FF00 ), array.push ( c_prcntSpctrm1, #CCFF00 ),
    array.push ( c_prcntSpctrm1, #D6FF00 ), array.push ( c_prcntSpctrm1, #E0FF00 ), array.push ( c_prcntSpctrm1, #EBFF00 ), array.push ( c_prcntSpctrm1, #F5FF00 ), array.push ( c_prcntSpctrm1, #FFFF00 ),
    array.push ( c_prcntSpctrm1, #FFF500 ), array.push ( c_prcntSpctrm1, #FFEB00 ), array.push ( c_prcntSpctrm1, #FFE000 ), array.push ( c_prcntSpctrm1, #FFD600 ), array.push ( c_prcntSpctrm1, #FFCC00 ),
    array.push ( c_prcntSpctrm1, #FFC200 ), array.push ( c_prcntSpctrm1, #FFB800 ), array.push ( c_prcntSpctrm1, #FFAD00 ), array.push ( c_prcntSpctrm1, #FFA300 ), array.push ( c_prcntSpctrm1, #FF9900 ),
    array.push ( c_prcntSpctrm1, #FF8F00 ), array.push ( c_prcntSpctrm1, #FF8500 ), array.push ( c_prcntSpctrm1, #FF7A00 ), array.push ( c_prcntSpctrm1, #FF7000 ), array.push ( c_prcntSpctrm1, #FF6600 ),
    array.push ( c_prcntSpctrm1, #FF5C00 ), array.push ( c_prcntSpctrm1, #FF5200 ), array.push ( c_prcntSpctrm1, #FF4700 ), array.push ( c_prcntSpctrm1, #FF3D00 ), array.push ( c_prcntSpctrm1, #FF3300 ),
    array.push ( c_prcntSpctrm1, #FF2900 ), array.push ( c_prcntSpctrm1, #FF1F00 ), array.push ( c_prcntSpctrm1, #FF1400 ), array.push ( c_prcntSpctrm1, #FF0000 ), array.push ( c_prcntSpctrm1, #FF0000 )

var c_prcntSpctrm2 = array.new_color(na)
if barstate.isfirst
    array.push ( c_prcntSpctrm2, #0000FF )
    array.push ( c_prcntSpctrm2, #0200FC ), array.push ( c_prcntSpctrm2, #0500F9 ), array.push ( c_prcntSpctrm2, #0700F7 ), array.push ( c_prcntSpctrm2, #0A00F4 ), array.push ( c_prcntSpctrm2, #0C00F2 ),
    array.push ( c_prcntSpctrm2, #0F00EF ), array.push ( c_prcntSpctrm2, #1100ED ), array.push ( c_prcntSpctrm2, #1400EA ), array.push ( c_prcntSpctrm2, #1600E8 ), array.push ( c_prcntSpctrm2, #1900E5 ),
    array.push ( c_prcntSpctrm2, #1C00E2 ), array.push ( c_prcntSpctrm2, #1E00E0 ), array.push ( c_prcntSpctrm2, #2100DD ), array.push ( c_prcntSpctrm2, #2300DB ), array.push ( c_prcntSpctrm2, #2600D8 ),
    array.push ( c_prcntSpctrm2, #2800D6 ), array.push ( c_prcntSpctrm2, #2B00D3 ), array.push ( c_prcntSpctrm2, #2D00D1 ), array.push ( c_prcntSpctrm2, #3000CE ), array.push ( c_prcntSpctrm2, #3300CC ),
    array.push ( c_prcntSpctrm2, #3500C9 ), array.push ( c_prcntSpctrm2, #3800C6 ), array.push ( c_prcntSpctrm2, #3A00C4 ), array.push ( c_prcntSpctrm2, #3D00C1 ), array.push ( c_prcntSpctrm2, #3F00BF ),
    array.push ( c_prcntSpctrm2, #4200BC ), array.push ( c_prcntSpctrm2, #4400BA ), array.push ( c_prcntSpctrm2, #4700B7 ), array.push ( c_prcntSpctrm2, #4900B5 ), array.push ( c_prcntSpctrm2, #4C00B2 ),
    array.push ( c_prcntSpctrm2, #4F00AF ), array.push ( c_prcntSpctrm2, #5100AD ), array.push ( c_prcntSpctrm2, #5400AA ), array.push ( c_prcntSpctrm2, #5600A8 ), array.push ( c_prcntSpctrm2, #5900A5 ),
    array.push ( c_prcntSpctrm2, #5B00A3 ), array.push ( c_prcntSpctrm2, #5E00A0 ), array.push ( c_prcntSpctrm2, #60009E ), array.push ( c_prcntSpctrm2, #63009B ), array.push ( c_prcntSpctrm2, #660099 ),
    array.push ( c_prcntSpctrm2, #680096 ), array.push ( c_prcntSpctrm2, #6B0093 ), array.push ( c_prcntSpctrm2, #6D0091 ), array.push ( c_prcntSpctrm2, #70008E ), array.push ( c_prcntSpctrm2, #72008C ),
    array.push ( c_prcntSpctrm2, #750089 ), array.push ( c_prcntSpctrm2, #770087 ), array.push ( c_prcntSpctrm2, #7A0084 ), array.push ( c_prcntSpctrm2, #7C0082 ), array.push ( c_prcntSpctrm2, #7F007F ),
    array.push ( c_prcntSpctrm2, #82007C ), array.push ( c_prcntSpctrm2, #84007A ), array.push ( c_prcntSpctrm2, #870077 ), array.push ( c_prcntSpctrm2, #890075 ), array.push ( c_prcntSpctrm2, #8C0072 ),
    array.push ( c_prcntSpctrm2, #8E0070 ), array.push ( c_prcntSpctrm2, #91006D ), array.push ( c_prcntSpctrm2, #93006B ), array.push ( c_prcntSpctrm2, #960068 ), array.push ( c_prcntSpctrm2, #990066 ),
    array.push ( c_prcntSpctrm2, #9B0063 ), array.push ( c_prcntSpctrm2, #9E0060 ), array.push ( c_prcntSpctrm2, #A0005E ), array.push ( c_prcntSpctrm2, #A3005B ), array.push ( c_prcntSpctrm2, #A50059 ),
    array.push ( c_prcntSpctrm2, #A80056 ), array.push ( c_prcntSpctrm2, #AA0054 ), array.push ( c_prcntSpctrm2, #AD0051 ), array.push ( c_prcntSpctrm2, #AF004F ), array.push ( c_prcntSpctrm2, #B2004C ),
    array.push ( c_prcntSpctrm2, #B50049 ), array.push ( c_prcntSpctrm2, #B70047 ), array.push ( c_prcntSpctrm2, #BA0044 ), array.push ( c_prcntSpctrm2, #BC0042 ), array.push ( c_prcntSpctrm2, #BF003F ),
    array.push ( c_prcntSpctrm2, #C1003D ), array.push ( c_prcntSpctrm2, #C4003A ), array.push ( c_prcntSpctrm2, #C60038 ), array.push ( c_prcntSpctrm2, #C90035 ), array.push ( c_prcntSpctrm2, #CC0033 ),
    array.push ( c_prcntSpctrm2, #CE0030 ), array.push ( c_prcntSpctrm2, #D1002D ), array.push ( c_prcntSpctrm2, #D3002B ), array.push ( c_prcntSpctrm2, #D60028 ), array.push ( c_prcntSpctrm2, #D80026 ),
    array.push ( c_prcntSpctrm2, #DB0023 ), array.push ( c_prcntSpctrm2, #DD0021 ), array.push ( c_prcntSpctrm2, #E0001E ), array.push ( c_prcntSpctrm2, #E2001C ), array.push ( c_prcntSpctrm2, #E50019 ),
    array.push ( c_prcntSpctrm2, #E80016 ), array.push ( c_prcntSpctrm2, #EA0014 ), array.push ( c_prcntSpctrm2, #ED0011 ), array.push ( c_prcntSpctrm2, #EF000F ), array.push ( c_prcntSpctrm2, #F2000C ),
    array.push ( c_prcntSpctrm2, #F4000A ), array.push ( c_prcntSpctrm2, #F70007 ), array.push ( c_prcntSpctrm2, #F90005 ), array.push ( c_prcntSpctrm2, #FC0002 ), array.push ( c_prcntSpctrm2, #FF0000 )

var string STM = 'Spectrum'
var string SLD = 'Solid'
var string BGR = 'Blue Green Red'
var string BR  = 'Blue Red'

///////////////////////////////////////////////////////////////////////////////
// inputs

i_priceSrc      = input.source  ( close,    'Price Source',                                                                         group='BBWP Properties')
i_basisType     = input.string  ( 'SMA',    'Basis Type',                       options=['SMA', 'EMA', 'VWMA'],                     group='BBWP Properties')
i_bbwpLen       = input.int     ( 13,       'Length',                           minval=1,                                           group='BBWP Properties')
i_bbwpLkbk      = input.int     ( 252,      'Lookback',                         minval=1,                                           group='BBWP Properties')

i_c_bbwpTyped   = input.string  ( STM,      'Color Type',                       options=[STM, SLD],                     inline='1', group='BBWP Plot Settings')
i_c_spctrmType  = input.string  ( BGR,      'Spectrum',                         options=[BR, BGR],                      inline='1', group='BBWP Plot Settings')
i_c_bbwpsolid   = input.color   ( #FFFF00,  'Solid',                                                                    inline='1', group='BBWP Plot Settings')
i_bbwpWidth     = input.int     ( 2,        'Line Width',                       minval=1, maxval=4,                     inline='2', group='BBWP Plot Settings')

i_ma1On         = input.bool    ( true, '',                                                                             inline='1', group='Moving Average Settings')
i_ma1Type       = input.string  ( 'SMA',    'MA 1 Type',                        options=['SMA', 'EMA', 'VWMA'],         inline='1', group='Moving Average Settings')
i_c_ma1         = input.color   ( #FFFFFF,  '',                                                                         inline='1', group='Moving Average Settings')
i_ma1Len        = input.int     ( 5,        'Length',                           minval=1,                               inline='1', group='Moving Average Settings')
i_ma2On         = input.bool    ( false,    '',                                                                         inline='2', group='Moving Average Settings')
i_ma2Type       = input.string  ( 'SMA',    'MA 2 Type',                        options=['SMA', 'EMA', 'VWMA'],         inline='2', group='Moving Average Settings')
i_c_ma2         = input.color   ( #00FFFF,  '',                                                                         inline='2', group='Moving Average Settings')
i_ma2Len        = input.int     ( 8,        'Length',                           minval=1,                               inline='2', group='Moving Average Settings')

i_alrtsOn       = input.bool    ( true,     'Alerts On',                                                                            group='Visual Alerts')
i_upperLevel    = input.int     ( 98,       'Extreme High',                     minval=1, inline='1',                               group='Visual Alerts')
i_lowerLevel    = input.int     ( 2,        'Extreme Low',                      minval=1, inline='1',                               group='Visual Alerts')

///////////////////////////////////////////////////////////////////////////////
// function declarations

f_maType ( _price, _len, _type ) =>
    _type == 'SMA' ? ta.sma ( _price, _len ) : _type == 'EMA' ? ta.ema ( _price, _len ) : ta.vwma ( _price, _len )

f_bbwp ( _price, _bbwLen, _bbwpLen, _type ) =>
    float _basis = f_maType ( _price, _bbwLen, _type )
    float _dev = ta.stdev ( _price, _bbwLen )
    _bbw = ( _basis + _dev - ( _basis - _dev )) / _basis
    _bbwSum = 0.0
    _len = bar_index < _bbwpLen ? bar_index : _bbwpLen
    for _i = 1 to _len by 1
        _bbwSum += ( _bbw[_i] > _bbw ? 0 : 1 )
        _bbwSum
    _return = bar_index >= _bbwLen ? ( _bbwSum / _len) * 100 : na
    _return

f_clrSlct ( _percent, _select, _type, _solid, _array1, _array2 ) =>
    _select == 'Solid' ? _solid : array.get ( _type == 'Blue Green Red' ? _array1 : _array2, math.round ( _percent ) )

/////////////////////////////////////////////////////////////////////////////// 
// calculations

bbwp        = f_bbwp ( i_priceSrc, i_bbwpLen, i_bbwpLkbk, i_basisType )
c_bbwp      = f_clrSlct ( bbwp, i_c_bbwpTyped, i_c_spctrmType, i_c_bbwpsolid, c_prcntSpctrm1, c_prcntSpctrm2 )
bbwpMA1     = i_ma1On ? f_maType ( bbwp, i_ma1Len, i_ma1Type ) : na
bbwpMA2     = i_ma2On ? f_maType ( bbwp, i_ma2Len, i_ma2Type ) : na
hiAlrtBar   = i_alrtsOn and bbwp >= i_upperLevel ? bbwp : na
loAlrtBar   = i_alrtsOn and bbwp <= i_lowerLevel ? bbwp : na

/////////////////////////////////////////////////////////////////////////////// 
// plots

p_scaleHi   = hline ( 100,  'Scale High', #ff0000, hline.style_solid )
p_midLine   = hline ( 50,   'Mid-Line', color.silver, hline.style_dashed )
p_scaleLo   = hline ( 0,    'Scale Low', #0000ff, hline.style_solid )

p_bbwp      = plot ( bbwp,      'BBWP',         c_bbwp, i_bbwpWidth, plot.style_line, editable=false )
p_hiAlrt    = plot ( hiAlrtBar, 'Extreme Hi',   c_bbwp, 1, plot.style_columns, histbase=0, editable=false )
p_loAlrt    = plot ( loAlrtBar, 'Extreme Lo',   c_bbwp, 1, plot.style_columns, histbase=100, editable=false )
p_ma1       = plot ( bbwpMA1,   'MA 1',         i_c_ma1, 1, plot.style_line, 0 )
p_ma2       = plot ( bbwpMA2,   'MA 2',         i_c_ma2, 1, plot.style_line, 0 )

/////////////////////////////
// end
Attachments
Be patient therefore, brethren, until the coming of the Lord. Behold, the husbandman waiteth for the precious fruit of the earth: patiently bearing till he receive the early and latter rain.
Behold, we account them blessed who have endured. You have heard of the patience of Job, and you have seen the end of the Lord, that the Lord is merciful and compassionate.

Re: MT4 Indicator requests and ideas

16104
honje19960321 wrote: Sat Jul 30, 2022 4:20 am Dear Mr.Tools can tradingview's BBW indicator be converted to MT4 version.
I think this metric is really great. Even better if it can be used on MT4.
Gratitude

https://tw.tradingview.com/script/tqitS ... ercentile/
https://tw.tradingview.com/script/uOPkV ... ime-Frame/

Code: Select all

//@version=5
//
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// @author  = The_Caretaker
// © The_Caretaker
//
// Much respect to John A Bollinger the creator of Bollinger Bands® and Bollinger Band Width indicators.
// 
// Feel free to reuse or develop this script further, please drop me a note below if you find it useful.
//

indicator('Bollinger Band Width Percentile', 'BBWP', overlay=false, format=format.percent, precision=2, max_bars_back = 1000)

///////////////////////////////////////////////////////////////////////////////
// variable declarations

var c_prcntSpctrm1 = array.new_color(na)
if barstate.isfirst
    array.push ( c_prcntSpctrm1, #0000FF )
    array.push ( c_prcntSpctrm1, #000AFF ), array.push ( c_prcntSpctrm1, #0014FF ), array.push ( c_prcntSpctrm1, #001FFF ), array.push ( c_prcntSpctrm1, #0029FF ), array.push ( c_prcntSpctrm1, #0033FF ),
    array.push ( c_prcntSpctrm1, #003DFF ), array.push ( c_prcntSpctrm1, #0047FF ), array.push ( c_prcntSpctrm1, #0052FF ), array.push ( c_prcntSpctrm1, #005CFF ), array.push ( c_prcntSpctrm1, #0066FF ),
    array.push ( c_prcntSpctrm1, #0070FF ), array.push ( c_prcntSpctrm1, #007AFF ), array.push ( c_prcntSpctrm1, #0085FF ), array.push ( c_prcntSpctrm1, #008FFF ), array.push ( c_prcntSpctrm1, #0099FF ),
    array.push ( c_prcntSpctrm1, #00A3FF ), array.push ( c_prcntSpctrm1, #00ADFF ), array.push ( c_prcntSpctrm1, #00B8FF ), array.push ( c_prcntSpctrm1, #00C2FF ), array.push ( c_prcntSpctrm1, #00CCFF ),
    array.push ( c_prcntSpctrm1, #00D6FF ), array.push ( c_prcntSpctrm1, #00E0FF ), array.push ( c_prcntSpctrm1, #00EBFF ), array.push ( c_prcntSpctrm1, #00F5FF ), array.push ( c_prcntSpctrm1, #00FFFF ),
    array.push ( c_prcntSpctrm1, #00FFF5 ), array.push ( c_prcntSpctrm1, #00FFEB ), array.push ( c_prcntSpctrm1, #00FFE0 ), array.push ( c_prcntSpctrm1, #00FFD6 ), array.push ( c_prcntSpctrm1, #00FFCC ),
    array.push ( c_prcntSpctrm1, #00FFC2 ), array.push ( c_prcntSpctrm1, #00FFB8 ), array.push ( c_prcntSpctrm1, #00FFAD ), array.push ( c_prcntSpctrm1, #00FFA3 ), array.push ( c_prcntSpctrm1, #00FF99 ),
    array.push ( c_prcntSpctrm1, #00FF8F ), array.push ( c_prcntSpctrm1, #00FF85 ), array.push ( c_prcntSpctrm1, #00FF7A ), array.push ( c_prcntSpctrm1, #00FF70 ), array.push ( c_prcntSpctrm1, #00FF66 ),
    array.push ( c_prcntSpctrm1, #00FF5C ), array.push ( c_prcntSpctrm1, #00FF52 ), array.push ( c_prcntSpctrm1, #00FF47 ), array.push ( c_prcntSpctrm1, #00FF3D ), array.push ( c_prcntSpctrm1, #00FF33 ),
    array.push ( c_prcntSpctrm1, #00FF29 ), array.push ( c_prcntSpctrm1, #00FF1F ), array.push ( c_prcntSpctrm1, #00FF14 ), array.push ( c_prcntSpctrm1, #00FF0A ), array.push ( c_prcntSpctrm1, #00FF00 ),
    array.push ( c_prcntSpctrm1, #0AFF00 ), array.push ( c_prcntSpctrm1, #14FF00 ), array.push ( c_prcntSpctrm1, #1FFF00 ), array.push ( c_prcntSpctrm1, #29FF00 ), array.push ( c_prcntSpctrm1, #33FF00 ),
    array.push ( c_prcntSpctrm1, #3DFF00 ), array.push ( c_prcntSpctrm1, #47FF00 ), array.push ( c_prcntSpctrm1, #52FF00 ), array.push ( c_prcntSpctrm1, #5CFF00 ), array.push ( c_prcntSpctrm1, #66FF00 ),
    array.push ( c_prcntSpctrm1, #70FF00 ), array.push ( c_prcntSpctrm1, #7AFF00 ), array.push ( c_prcntSpctrm1, #85FF00 ), array.push ( c_prcntSpctrm1, #8FFF00 ), array.push ( c_prcntSpctrm1, #99FF00 ),
    array.push ( c_prcntSpctrm1, #A3FF00 ), array.push ( c_prcntSpctrm1, #ADFF00 ), array.push ( c_prcntSpctrm1, #B8FF00 ), array.push ( c_prcntSpctrm1, #C2FF00 ), array.push ( c_prcntSpctrm1, #CCFF00 ),
    array.push ( c_prcntSpctrm1, #D6FF00 ), array.push ( c_prcntSpctrm1, #E0FF00 ), array.push ( c_prcntSpctrm1, #EBFF00 ), array.push ( c_prcntSpctrm1, #F5FF00 ), array.push ( c_prcntSpctrm1, #FFFF00 ),
    array.push ( c_prcntSpctrm1, #FFF500 ), array.push ( c_prcntSpctrm1, #FFEB00 ), array.push ( c_prcntSpctrm1, #FFE000 ), array.push ( c_prcntSpctrm1, #FFD600 ), array.push ( c_prcntSpctrm1, #FFCC00 ),
    array.push ( c_prcntSpctrm1, #FFC200 ), array.push ( c_prcntSpctrm1, #FFB800 ), array.push ( c_prcntSpctrm1, #FFAD00 ), array.push ( c_prcntSpctrm1, #FFA300 ), array.push ( c_prcntSpctrm1, #FF9900 ),
    array.push ( c_prcntSpctrm1, #FF8F00 ), array.push ( c_prcntSpctrm1, #FF8500 ), array.push ( c_prcntSpctrm1, #FF7A00 ), array.push ( c_prcntSpctrm1, #FF7000 ), array.push ( c_prcntSpctrm1, #FF6600 ),
    array.push ( c_prcntSpctrm1, #FF5C00 ), array.push ( c_prcntSpctrm1, #FF5200 ), array.push ( c_prcntSpctrm1, #FF4700 ), array.push ( c_prcntSpctrm1, #FF3D00 ), array.push ( c_prcntSpctrm1, #FF3300 ),
    array.push ( c_prcntSpctrm1, #FF2900 ), array.push ( c_prcntSpctrm1, #FF1F00 ), array.push ( c_prcntSpctrm1, #FF1400 ), array.push ( c_prcntSpctrm1, #FF0000 ), array.push ( c_prcntSpctrm1, #FF0000 )

var c_prcntSpctrm2 = array.new_color(na)
if barstate.isfirst
    array.push ( c_prcntSpctrm2, #0000FF )
    array.push ( c_prcntSpctrm2, #0200FC ), array.push ( c_prcntSpctrm2, #0500F9 ), array.push ( c_prcntSpctrm2, #0700F7 ), array.push ( c_prcntSpctrm2, #0A00F4 ), array.push ( c_prcntSpctrm2, #0C00F2 ),
    array.push ( c_prcntSpctrm2, #0F00EF ), array.push ( c_prcntSpctrm2, #1100ED ), array.push ( c_prcntSpctrm2, #1400EA ), array.push ( c_prcntSpctrm2, #1600E8 ), array.push ( c_prcntSpctrm2, #1900E5 ),
    array.push ( c_prcntSpctrm2, #1C00E2 ), array.push ( c_prcntSpctrm2, #1E00E0 ), array.push ( c_prcntSpctrm2, #2100DD ), array.push ( c_prcntSpctrm2, #2300DB ), array.push ( c_prcntSpctrm2, #2600D8 ),
    array.push ( c_prcntSpctrm2, #2800D6 ), array.push ( c_prcntSpctrm2, #2B00D3 ), array.push ( c_prcntSpctrm2, #2D00D1 ), array.push ( c_prcntSpctrm2, #3000CE ), array.push ( c_prcntSpctrm2, #3300CC ),
    array.push ( c_prcntSpctrm2, #3500C9 ), array.push ( c_prcntSpctrm2, #3800C6 ), array.push ( c_prcntSpctrm2, #3A00C4 ), array.push ( c_prcntSpctrm2, #3D00C1 ), array.push ( c_prcntSpctrm2, #3F00BF ),
    array.push ( c_prcntSpctrm2, #4200BC ), array.push ( c_prcntSpctrm2, #4400BA ), array.push ( c_prcntSpctrm2, #4700B7 ), array.push ( c_prcntSpctrm2, #4900B5 ), array.push ( c_prcntSpctrm2, #4C00B2 ),
    array.push ( c_prcntSpctrm2, #4F00AF ), array.push ( c_prcntSpctrm2, #5100AD ), array.push ( c_prcntSpctrm2, #5400AA ), array.push ( c_prcntSpctrm2, #5600A8 ), array.push ( c_prcntSpctrm2, #5900A5 ),
    array.push ( c_prcntSpctrm2, #5B00A3 ), array.push ( c_prcntSpctrm2, #5E00A0 ), array.push ( c_prcntSpctrm2, #60009E ), array.push ( c_prcntSpctrm2, #63009B ), array.push ( c_prcntSpctrm2, #660099 ),
    array.push ( c_prcntSpctrm2, #680096 ), array.push ( c_prcntSpctrm2, #6B0093 ), array.push ( c_prcntSpctrm2, #6D0091 ), array.push ( c_prcntSpctrm2, #70008E ), array.push ( c_prcntSpctrm2, #72008C ),
    array.push ( c_prcntSpctrm2, #750089 ), array.push ( c_prcntSpctrm2, #770087 ), array.push ( c_prcntSpctrm2, #7A0084 ), array.push ( c_prcntSpctrm2, #7C0082 ), array.push ( c_prcntSpctrm2, #7F007F ),
    array.push ( c_prcntSpctrm2, #82007C ), array.push ( c_prcntSpctrm2, #84007A ), array.push ( c_prcntSpctrm2, #870077 ), array.push ( c_prcntSpctrm2, #890075 ), array.push ( c_prcntSpctrm2, #8C0072 ),
    array.push ( c_prcntSpctrm2, #8E0070 ), array.push ( c_prcntSpctrm2, #91006D ), array.push ( c_prcntSpctrm2, #93006B ), array.push ( c_prcntSpctrm2, #960068 ), array.push ( c_prcntSpctrm2, #990066 ),
    array.push ( c_prcntSpctrm2, #9B0063 ), array.push ( c_prcntSpctrm2, #9E0060 ), array.push ( c_prcntSpctrm2, #A0005E ), array.push ( c_prcntSpctrm2, #A3005B ), array.push ( c_prcntSpctrm2, #A50059 ),
    array.push ( c_prcntSpctrm2, #A80056 ), array.push ( c_prcntSpctrm2, #AA0054 ), array.push ( c_prcntSpctrm2, #AD0051 ), array.push ( c_prcntSpctrm2, #AF004F ), array.push ( c_prcntSpctrm2, #B2004C ),
    array.push ( c_prcntSpctrm2, #B50049 ), array.push ( c_prcntSpctrm2, #B70047 ), array.push ( c_prcntSpctrm2, #BA0044 ), array.push ( c_prcntSpctrm2, #BC0042 ), array.push ( c_prcntSpctrm2, #BF003F ),
    array.push ( c_prcntSpctrm2, #C1003D ), array.push ( c_prcntSpctrm2, #C4003A ), array.push ( c_prcntSpctrm2, #C60038 ), array.push ( c_prcntSpctrm2, #C90035 ), array.push ( c_prcntSpctrm2, #CC0033 ),
    array.push ( c_prcntSpctrm2, #CE0030 ), array.push ( c_prcntSpctrm2, #D1002D ), array.push ( c_prcntSpctrm2, #D3002B ), array.push ( c_prcntSpctrm2, #D60028 ), array.push ( c_prcntSpctrm2, #D80026 ),
    array.push ( c_prcntSpctrm2, #DB0023 ), array.push ( c_prcntSpctrm2, #DD0021 ), array.push ( c_prcntSpctrm2, #E0001E ), array.push ( c_prcntSpctrm2, #E2001C ), array.push ( c_prcntSpctrm2, #E50019 ),
    array.push ( c_prcntSpctrm2, #E80016 ), array.push ( c_prcntSpctrm2, #EA0014 ), array.push ( c_prcntSpctrm2, #ED0011 ), array.push ( c_prcntSpctrm2, #EF000F ), array.push ( c_prcntSpctrm2, #F2000C ),
    array.push ( c_prcntSpctrm2, #F4000A ), array.push ( c_prcntSpctrm2, #F70007 ), array.push ( c_prcntSpctrm2, #F90005 ), array.push ( c_prcntSpctrm2, #FC0002 ), array.push ( c_prcntSpctrm2, #FF0000 )

var string STM = 'Spectrum'
var string SLD = 'Solid'
var string BGR = 'Blue Green Red'
var string BR  = 'Blue Red'

///////////////////////////////////////////////////////////////////////////////
// inputs

i_priceSrc      = input.source  ( close,    'Price Source',                                                                         group='BBWP Properties')
i_basisType     = input.string  ( 'SMA',    'Basis Type',                       options=['SMA', 'EMA', 'VWMA'],                     group='BBWP Properties')
i_bbwpLen       = input.int     ( 13,       'Length',                           minval=1,                                           group='BBWP Properties')
i_bbwpLkbk      = input.int     ( 252,      'Lookback',                         minval=1,                                           group='BBWP Properties')

i_c_bbwpTyped   = input.string  ( STM,      'Color Type',                       options=[STM, SLD],                     inline='1', group='BBWP Plot Settings')
i_c_spctrmType  = input.string  ( BGR,      'Spectrum',                         options=[BR, BGR],                      inline='1', group='BBWP Plot Settings')
i_c_bbwpsolid   = input.color   ( #FFFF00,  'Solid',                                                                    inline='1', group='BBWP Plot Settings')
i_bbwpWidth     = input.int     ( 2,        'Line Width',                       minval=1, maxval=4,                     inline='2', group='BBWP Plot Settings')

i_ma1On         = input.bool    ( true, '',                                                                             inline='1', group='Moving Average Settings')
i_ma1Type       = input.string  ( 'SMA',    'MA 1 Type',                        options=['SMA', 'EMA', 'VWMA'],         inline='1', group='Moving Average Settings')
i_c_ma1         = input.color   ( #FFFFFF,  '',                                                                         inline='1', group='Moving Average Settings')
i_ma1Len        = input.int     ( 5,        'Length',                           minval=1,                               inline='1', group='Moving Average Settings')
i_ma2On         = input.bool    ( false,    '',                                                                         inline='2', group='Moving Average Settings')
i_ma2Type       = input.string  ( 'SMA',    'MA 2 Type',                        options=['SMA', 'EMA', 'VWMA'],         inline='2', group='Moving Average Settings')
i_c_ma2         = input.color   ( #00FFFF,  '',                                                                         inline='2', group='Moving Average Settings')
i_ma2Len        = input.int     ( 8,        'Length',                           minval=1,                               inline='2', group='Moving Average Settings')

i_alrtsOn       = input.bool    ( true,     'Alerts On',                                                                            group='Visual Alerts')
i_upperLevel    = input.int     ( 98,       'Extreme High',                     minval=1, inline='1',                               group='Visual Alerts')
i_lowerLevel    = input.int     ( 2,        'Extreme Low',                      minval=1, inline='1',                               group='Visual Alerts')

///////////////////////////////////////////////////////////////////////////////
// function declarations

f_maType ( _price, _len, _type ) =>
    _type == 'SMA' ? ta.sma ( _price, _len ) : _type == 'EMA' ? ta.ema ( _price, _len ) : ta.vwma ( _price, _len )

f_bbwp ( _price, _bbwLen, _bbwpLen, _type ) =>
    float _basis = f_maType ( _price, _bbwLen, _type )
    float _dev = ta.stdev ( _price, _bbwLen )
    _bbw = ( _basis + _dev - ( _basis - _dev )) / _basis
    _bbwSum = 0.0
    _len = bar_index < _bbwpLen ? bar_index : _bbwpLen
    for _i = 1 to _len by 1
        _bbwSum += ( _bbw[_i] > _bbw ? 0 : 1 )
        _bbwSum
    _return = bar_index >= _bbwLen ? ( _bbwSum / _len) * 100 : na
    _return

f_clrSlct ( _percent, _select, _type, _solid, _array1, _array2 ) =>
    _select == 'Solid' ? _solid : array.get ( _type == 'Blue Green Red' ? _array1 : _array2, math.round ( _percent ) )

/////////////////////////////////////////////////////////////////////////////// 
// calculations

bbwp        = f_bbwp ( i_priceSrc, i_bbwpLen, i_bbwpLkbk, i_basisType )
c_bbwp      = f_clrSlct ( bbwp, i_c_bbwpTyped, i_c_spctrmType, i_c_bbwpsolid, c_prcntSpctrm1, c_prcntSpctrm2 )
bbwpMA1     = i_ma1On ? f_maType ( bbwp, i_ma1Len, i_ma1Type ) : na
bbwpMA2     = i_ma2On ? f_maType ( bbwp, i_ma2Len, i_ma2Type ) : na
hiAlrtBar   = i_alrtsOn and bbwp >= i_upperLevel ? bbwp : na
loAlrtBar   = i_alrtsOn and bbwp <= i_lowerLevel ? bbwp : na

/////////////////////////////////////////////////////////////////////////////// 
// plots

p_scaleHi   = hline ( 100,  'Scale High', #ff0000, hline.style_solid )
p_midLine   = hline ( 50,   'Mid-Line', color.silver, hline.style_dashed )
p_scaleLo   = hline ( 0,    'Scale Low', #0000ff, hline.style_solid )

p_bbwp      = plot ( bbwp,      'BBWP',         c_bbwp, i_bbwpWidth, plot.style_line, editable=false )
p_hiAlrt    = plot ( hiAlrtBar, 'Extreme Hi',   c_bbwp, 1, plot.style_columns, histbase=0, editable=false )
p_loAlrt    = plot ( loAlrtBar, 'Extreme Lo',   c_bbwp, 1, plot.style_columns, histbase=100, editable=false )
p_ma1       = plot ( bbwpMA1,   'MA 1',         i_c_ma1, 1, plot.style_line, 0 )
p_ma2       = plot ( bbwpMA2,   'MA 2',         i_c_ma2, 1, plot.style_line, 0 )

/////////////////////////////
// end
Image
Isn't that the same as this one here Percent BB except the coloring?


Re: MT4 Indicator requests and ideas

16107
CloudyMG wrote: Sat Jul 30, 2022 11:40 am Hello guys please do try my first system posted here :)
obvious rules i found out about are written on the pictures and for each example i use a * with its own color , although some examples dont have the signals but had to use them to avoid uploading many pictures.
since price doesn't always hit our price levels we can use obvious trendlines for levels aswell.
i like my chart to be clean and show candles as they are.

-----------------------------------------------------------------------------------

There is also a position size calculator in the zip file , if you want to use it you have to copy its script to script folder and for entry open the script , its a double click entry so its faster and it ends the script after entry so dont worry about risking more than it can risk , dont forget to always check the position size calculator numbers in its window ( for example i shorted a long trade with higher risk ^_^)
plz do give me suggestions , and let us newbies in forex-station make some great systems like the big guys (xard-beatlemania-pumba)
thanks again for reading <3 <3
Cloudy1.0.rar
Thanks for sharing your system, if possible, could you please start your own thread with your system, we like to keep this area for requests and ideas.

Moving AveragesRe: MT4 Indicator requests and ideas

16108
mrtools wrote: Sat Jul 30, 2022 5:33 am Isn't that the same as this one here Percent BB except the coloring?
Not so, dear Mr. Tool. I think this indicator is more like an upgraded version of Bollinger Band width with percentage and color display added. to determine the size of the trend.


I appreciate everything you have done

Just to recap:

Introducing the Bollinger Band Width Percentile

Definitions :

Bollinger Band Width Percentile is derived from the Bollinger Band Width indicator.
It shows the percentage of bars over a specified lookback period that the Bollinger Band Width was less than the current Bollinger Band Width.

Bollinger Band Width is derived from the Bollinger Bands® indicator.
It quantitatively measures the width between the Upper and Lower Bands of the Bollinger Bands .

Bollinger Bands® is a volatility-based indicator.
It consists of three lines which are plotted in relation to a security's price.
The Middle Line is typically a Simple Moving Average .
The Upper and Lower Bands are typically 2 standard deviations above, and below the SMA (Middle Line).

Volatility is a statistical measure of the dispersion of returns for a given security or market index, measured by the standard deviation of logarithmic returns.


The Broad Concept :

Quoting Tradingview specifically for commonly noted limitations of the BBW indicator which I have based this indicator on....

“Bollinger Bands Width ( BBW ) outputs a Percentage Difference between the Upper Band and the Lower Band.
This value is used to define the narrowness of the bands.
What needs to be understood however is that a trader cannot simply look at the BBW value and determine if the Band is truly narrow or not.
The significance of an instruments relative narrowness changes depending on the instrument or security in question.
What is considered narrow for one security may not be for another.
What is considered narrow for one security may even change within the scope of the same security depending on the timeframe.
In order to accurately gauge the significance of a narrowing of the bands, a technical analyst will need to research past BBW fluctuations and price performance to increase trading accuracy.”

Here I present the Bollinger Band Width Percentile as a refinement of the BBW to somewhat overcome the limitations cited above.
Much of the work researching past BBW fluctuations, and making relative comparisons is done naturally by calculating the Bollinger Band Width Percentile.
This calculation also means that it can be read in a similar fashion across assets, greatly simplifying the interpretation of it.


Plotted Components of the Bollinger Band Width Percentile indicator :

Scale High
Mid Line
Scale Low

BBWP plot
Moving Average 1
Moving Average 2

Extreme High Alert
Extreme Low Alert


Bollinger Band Width Percentile Properties:

BBWP Length
The time period to be used in calculating the Moving average which creates the Basis for the BBW component of the BBWP.

Basis Type
The type of moving average to be used as the Basis for the BBW component of the BBWP.

BBWP Lookback
The lookback period to be used in calculating the BBWP itself.

BBWP Plot settings
The BBWP plot settings give a choice between a user defined solid color, and a choice of "Blue Green Red", or "Blue Red" spectrum palettes.

Moving Averages
Has 2 Optional User definable and adjustable moving averages of the BBWP.

Visual Alerts
Optional User adjustable High and low Signal columns.


How to read the BBWP :
A BBWP read of 95 % ... means that the current BBW level is greater than 95% of the lookback period.
A BBWP read of 5 % .... means that the current BBW level is lower than 95% of the lookback period.

Proposed interpretations :
When the BBWP gets above 90 % and particularly when it hits 100% ... this can be a signal that volatility is reaching a maximum and that a macro High or Low is about to be set.
When the BBWP gets below 10 % and particularly when it hits 0% ...... this can be a signal that volatility is reaching a minimum and that there could be a violent range breakout into a trending move.
When the BBWP hits a low level < 5 % and then gets above its moving average ...... this can be an early signal that a consolidation phase is ending and a trending move is beginning.
When the BBWP hits a high level > 95 % and then falls below its moving average ... this can be an early signal that a trending move is ending and a consolidation phase is beginning.

Essential knowledge :
The BBWP was designed with the daily timeframe in mind, but technical analysists may find use for it on other time frames also.
High and Low BBWP readings do not entail any direction bias.


Deeper Concepts :

In finance, “mean reversion” is the assumption that a financial instrument's price will tend to move towards the average price over time.

If we apply that same logic to volatility as represented here by the Bollinger band width percentile, the assumption is that the Bollinger band width percentile will tend to contract from extreme highs, and expand from extreme lows over time corresponding to repeated phases of contraction and expansion of volatility .

It is clear that for most assets there are periods of directional trending behavior followed by periods of “consolidation” ( trading sideways in a range ).
This often ends with a tightening range under reducing volume and volatility ( popularly known as “the squeeze” ).
The squeeze typically ends with a “breakout” from the range characterized by a rapid increase in volume , and volatility when price action again trends directionally, and the cycle repeats.

Typical Use Cases :

The Bollinger Band Width Percentile may be especially useful for Options traders, as it can provide a bias for when Options are relatively expensive, or inexpensive from a Volatility ( Vega ) perspective.
When the Bollinger Band Width Percentile is relatively high ( 85 percentile or above ) it may be more advantageous to be a net seller of Vega .
When the Bollinger Band Width Percentile is relatively low ( 15 percentile or below ) it may be advantageous to be net long Vega .

Here we examine a number of actionable signals on BTCUSD daily timeframe using the BBWP and a momentum oscillator ( using the TSI here but can equally be used with Bollinger bands , moving averages, or the traders preferred momentum oscillator ).

In this first case we will examine how a spot trader and an options trader could each use a low BBWP read to alert them to a good potential trade setup.
note: using a period of 30 for both the Bollinger bands and the BBWP period ( approximately a month ) and a BBWP lookback of 350 ( approximately a year )



As we see the Bollinger Bands have gradually contracted while price action trended down and the BBWP also fell consistently while below its moving average ( denoting falling volatility ) down to an extremely low level <5% until it broke above its moving average along with a break of range to the upside ( signaling the end of the consolidation at a low level and the beginning of a new trending move to the upside with expanding volatility ).



In this next case we will continue to follow the price action presuming that the traders have taken or locked in profit at reasonable take profit levels from the previous trade setup
Here we see the contraction of the Bollinger bands , and the BBWP alongside price action breaking below the BB Basis giving a warning that the trending move to the upside is likely over.
We then see the BBWP rising and getting above its moving average while price action fails to get above the BB Basis, likewise the TSI fails to get above its signal line and actually crosses below its zeroline.
The trader would normally take this as a signal that the next trending move could be to the downside.
The next trending move turns out to be a dramatic downside move which causes the BBWP to hit 100% signaling that volatility is likely to hit a maximum giving good opportunities for profitable trades to the skilled trader as outlined.


Limitations :

Here we will look at 2 cases where blindly taking BBWP signals could cause the trader to take a failed trade.

In this first example we will look at blindly taking a low volatility options trade
Low Volatility and corresponding low BBWP levels do not automatically mean there has to be expansion immediately, these periods of extreme low volatility can go on for quite some time.

High volatility and corresponding high BBWP levels do not automatically mean there has to be a macro high and contraction of volatility immediately, these periods of extreme high volatility can also go on for quite some time, hence the famous saying "The trend is your friend until the end of the trend" and lesser well known, but equally valid saying "never try to short the top of a parabolic blow off top"

Markets are variable and past performance is no guarantee of future results, this is not financial advice, I am not a financial advisor.


Final thoughts

The BBWP is an improvement over the BBW in my opinion, and is a novel, and useful addition to a Technical Analysts toolkit.
It is not a standalone indicator and is meant to be used in conjunction with other tools for direction bias, and Good Risk Management to base sound trades off.

John Bollinger has suggested using Bolliger bands, and its related indicators with two or three other non-correlated indicators that provide more direct market signals.
He believes it is crucial to use indicators based on different types of data.

Some of his favored technical techniques are moving average divergence/convergence ( MACD ), on-balance volume and relative strength index ( RSI ).

Thanks

Massive respect to John Bollinger , long-time technician of the markets, and legendary creator of both the Bollinger Bands® in the 1980´s, and the Bollinger band Width indicator in 2010 which this indicator is based on.
His work continues to inspire, decades after he brought the original Bollinger Bands to the market.
Much respect also to Eric Crown who gave me the fundamental knowledge of Technical Analysis , and Options trading.



In this second example we will look at blindly taking a high volatility spot short trade
These users thanked the author Jedidiah for the post (total 2):
Chickenspicy, talaate
Be patient therefore, brethren, until the coming of the Lord. Behold, the husbandman waiteth for the precious fruit of the earth: patiently bearing till he receive the early and latter rain.
Behold, we account them blessed who have endured. You have heard of the patience of Job, and you have seen the end of the Lord, that the Lord is merciful and compassionate.


Who is online

Users browsing this forum: Amazon [Bot], Applebot [Crawler], ChatGPT [Bot], Jimmy, lyo99, muhammadFarooq2k20, witori, Yandex [Bot] and 88 guests