.


Re: Indicator requests and ideas

#3292
Hi guys!,
i have a small request, while browsing the tradingview platform i came across an indicator based on the force index, it`s called "BB Lathe 2" made it by @sclark39, but it`s written in Pine..i was wondering if is possible to re-write it for mt4, thanks guys i really appreciated..
here`s the pine source code:

Code: Select all

//@version=3
// -------
// BB Lathe 2 by @sclark39
// Tip Jar ETH: 0xf8E0Ea503B5c833fD4546E7fa2c70EcE42A27C8A
// -------
study(shorttitle="BBLathe_FI", title="Bollinger Band Lathe w/ Elder's Force Index [sclark39]", overlay=false)

bollperiod = input(title="Bollinger Period", defval=20, minval=1)
signalperiod = input(title="BB Basis Signal Period", defval=9, minval=1)
fiperiod = input( title="Force Index EMA Period", defval=2, minval=1)
fisf = input( title="Force Index Scale Factor", defval = 0.5, minval=0.0 )
fi_asf_len = input( title="Force Index Auto-Scale Period", defval = 400, minval=1)
mult = input( title="BB STDEV", defval=2.0, minval=0.001, maxval=50)
multlow = input( title="BB STDEV Inner", defval=1.0, minval=0.001, maxval=50)
useemaforboll = input(title = 'Use EMA for BB?',defval=true, type=bool)
usemystdev = input(title = 'Use High Precision STDEV?',defval=true, type=bool)
invertshadow = input(title = 'Invert Shadow?',defval=false, type=bool)
fi_2col = input(title = '2-Color Force Index?',defval=false, type=bool)

src = input(close, title="Bollinger Source")


stdev2( mean, src, len ) => sqrt( sum( pow( src - mean, 2 ), len ) / ( len - 1 ) )
    
boll( src, len ) =>  
    sf = 0.0
    sf := na( sf[1] ) ? src : sf[1]
    src2 = src / sf // Increase precision, especially for low cryptocurrency
    mean = useemaforboll ? ema( src2, len ) : sma( src2, len )
    dev = usemystdev ? stdev2( mean, src2, len ) : stdev( src2, len )
    [ mean * sf, dev * sf ]
    
[basis,dev] = boll( src, bollperiod )

hist = basis - ema(basis,signalperiod)
normprice = close - basis
forceindex = ( close - close[1] ) * volume / sma( volume, fi_asf_len ) * fisf
fi_ema = ema( forceindex, fiperiod )
fi_color = fi_2col ? fi_ema > 0 ? green : red : white

t2 = plot( 0 + dev * mult, title="Upper Band", transp = 100)
b2 = plot( 0 - dev * mult, title="Lower Band",  transp = 100)

t1 = plot( 0 + dev * multlow, title="Upper Band Inner", transp = 100)
b1 = plot( 0 - dev * multlow, title="Lower Band Inner", transp = 100)

fill( t1, t2, title="Upper Band", transp = 70, color=gray )
fill( b1, b2, title="Lower Band",  transp = 70, color=gray )
fill( t1, b1, title="Inner Band",  transp = 95, color=gray )

plot( invertshadow ? hist : -hist, title="Basis Movement Shadow", style = area, color= hist > 0 ? green : red, transp=85 )
plot( normprice, title="Normalized Price", color = yellow, linewidth = 2 )
plot( fi_ema, title="Force Index", color=fi_color, style=histogram, linewidth= 1, transp = 0 )

plot( 0, title="Basis (Zero)", color = aqua )


and here`s how it should look like..


Capture.jpg

Re: Indicator requests and ideas

#3293
mrtools wrote:
Fri May 18, 2018 3:00 am


Added the prices and added the standard FS alerts and made the arrows a buffer now, so it should be a little less on the computer resources.
Hello, mrtools.
Thank you very much. Please if possible add a few more. At least VEMA, VWMA, HULL, ADXMA and a volume weighted hull MA (if such a thing exists).

Thanks and regards
Know Thy Setup. Know Thyself.

Re: Indicator requests and ideas

#3295
shaileshm wrote:
Fri May 18, 2018 1:33 pm
mrtools wrote:
Fri May 18, 2018 3:00 am


Added the prices and added the standard FS alerts and made the arrows a buffer now, so it should be a little less on the computer resources.
Hello, mrtools.
Thank you very much. Please if possible add a few more. At least VEMA, VWMA, HULL, ADXMA and a volume weighted hull MA (if such a thing exists).

Thanks and regards
Added all the average options and you can choose how to display it.
Attachments
averages ribbon filled (alerts + arrows).ex4
(137.17 KiB) Downloaded 267 times
avgs filled.png




Who is online

Users browsing this forum: alozard, emicovi, Google [Bot], JAMIL, mades, nrv, Pava, pawel.kowalski, pin12, tutank and 48 guests