The Twiggs Money Flow indicator was created by Collin Twiggs.
It is a variation of the Chaikin Money Flow Index that uses ranges and volumes in its formulation.
This code is an adaptation of the tradingview platform code: https: //www.tradingview.com/script/Jccjg8CR-Indicators-Twiggs-Money-Flow-TMF-Wilder-s-MA-WiMA/
In this version, the average is configurable, being possible to choose between simple, exponential, wilder ..
—–
El indicador Twiggs Money Flow fué creado por Collin Twiggs .
Es una variación del Chaikin Money Flow Index que utiliza rangos y volúmenes en su formulación.
Este código es una adaptación del código de la plataforma tradingview :https://www.tradingview.com/script/Jccjg8CR-Indicators-Twiggs-Money-Flow-TMF-Wilder-s-MA-WiMA/
En esta versión , la media es configurable , siendo posible elegir entre simple,exponencial ,de wilder..
REM TWIGGS MONEY FLOW
// adaptación del código de LazyBear en tradingview para PRT
// parámetro t = tipo de media en cuadro de variables
lenght=21
hline=0
trh=MAX(close[1],high)
trl=MIN(close[1],low)
trc=trh-trl
if trc=0.9999999 then
trc=trc
endif
adv=VOLUME*((close-trl)-(trh-close))/trc
wv=VOLUME+(VOLUME[1]*0)
wmV=Average[lenght,t](wv)
wmA=Average[lenght,t](adv)
if wmV=0 then
wmV=0
else
tmf=wmA/wmV
endif
RETURN tmf as "twiggs money flow",hline as "0",0.20 as "0.20",-0.20 as "-0.20"