// @author LazyBear
// @credits www.incrediblecharts...wiggs_money_flow.php
// If you use this code in its original/modified form, do drop me a note.
// Two Features Added by User ChrisMoody -
// TMF Line to be uses with Histogram(Easier to Spot Divergences)
// Thresh Hold lines showing extremes - adjustable.
study("Twiggs Money Flow ", shorttitle="LB_TMF")
length = input( 21, " TMF Period")
sh = input(true, title="Show Histogram?")
sl = input(true, title="Show TMF Line?")
// stl = input(true, title="Use Threshold Lines Color Change?")
sw = input(false, title="If Not Using Threshold Lines Color Change Change Below Values to 0")
upper_threshold = input(.1, minval=0, title="UpperThreshold ---- Default Value .1")
lower_threshold = input(-.1, minval=-1, title="Lower Threshold ---- Default Value -.1")
WiMA(src, length) =>
MA_s=(src + nz (MA_s * (length-1)))/length
MA_s
tr_h=max(close,high)
tr_l=min(close,low)
tr_c=tr_h-tr_l
adv=volume*((close-tr_l)-(tr_h-close))/ iff(tr_c==0,9999999,tr_c)
wv=volume+(volume*0)
wmV= WiMA(wv,length)
wmA= WiMA( adv ,length)
tmf= iff(wmV==0,0, wmA /wmV)
c = tmf >= upper_threshold ? lime : tmf < lower_threshold ? red : yellow
plot(sh and tmf ? tmf : na, title="Twiggs Money Flow Histogram", style=histogram, linewidth=3, color=c)
plot(sl and sma ( tmf , 1) ? sma ( tmf , 1) : na, title="Twiggs Money Flow Line", style=line, linewidth=4, color=white)
hline(0, title="0 Line", color=silver, linestyle=solid, linewidth=3)
hline(upper_threshold, title="Upper Threshold", linewidth=3, color=gray)
hline(lower_threshold, title="Lower Threshold", linewidth=3, color=gray)
// @credits www.incrediblecharts...wiggs_money_flow.php
// If you use this code in its original/modified form, do drop me a note.
// Two Features Added by User ChrisMoody -
// TMF Line to be uses with Histogram(Easier to Spot Divergences)
// Thresh Hold lines showing extremes - adjustable.
study("Twiggs Money Flow ", shorttitle="LB_TMF")
length = input( 21, " TMF Period")
sh = input(true, title="Show Histogram?")
sl = input(true, title="Show TMF Line?")
// stl = input(true, title="Use Threshold Lines Color Change?")
sw = input(false, title="If Not Using Threshold Lines Color Change Change Below Values to 0")
upper_threshold = input(.1, minval=0, title="UpperThreshold ---- Default Value .1")
lower_threshold = input(-.1, minval=-1, title="Lower Threshold ---- Default Value -.1")
WiMA(src, length) =>
MA_s=(src + nz (MA_s * (length-1)))/length
MA_s
tr_h=max(close,high)
tr_l=min(close,low)
tr_c=tr_h-tr_l
adv=volume*((close-tr_l)-(tr_h-close))/ iff(tr_c==0,9999999,tr_c)
wv=volume+(volume*0)
wmV= WiMA(wv,length)
wmA= WiMA( adv ,length)
tmf= iff(wmV==0,0, wmA /wmV)
c = tmf >= upper_threshold ? lime : tmf < lower_threshold ? red : yellow
plot(sh and tmf ? tmf : na, title="Twiggs Money Flow Histogram", style=histogram, linewidth=3, color=c)
plot(sl and sma ( tmf , 1) ? sma ( tmf , 1) : na, title="Twiggs Money Flow Line", style=line, linewidth=4, color=white)
hline(0, title="0 Line", color=silver, linestyle=solid, linewidth=3)
hline(upper_threshold, title="Upper Threshold", linewidth=3, color=gray)
hline(lower_threshold, title="Lower Threshold", linewidth=3, color=gray)