Nicolas

FantailVMA

Category: Indicators By: Nicolas Created: April 13, 2023, 1:00 PM
April 13, 2023, 1:00 PM
Indicators
5 Comments
FantailVMA

This is FantailVMA indicator, converted from PineScript.

The FantailVMA is a type of moving average that adjusts its sensitivity to the price action of the instrument based on the volatility of the market. This makes it a more responsive indicator compared to traditional moving averages. The ADX and VMA indicators are used in the calculation of the FVMA to further enhance its responsiveness to changes in the market.

The indicator is a combination of Moving Average and Average True Range indicators. It shows trend movements.

//PRC_FantailVMA | indicator
//13.04.23
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//author: bixord

// --- settings 
ADXLength=2 //ADX_Length
Weighting=10.0 //Weighting
MALength=6 //MA Length This must be =1 so that the VMA base line does not get averaged.
// --- end of settings 

VMA=close
VarMA=close
MA=close
STR = high-low
//
Hi  = high
Hi1 = high[1]
Lo  = low
Lo1 = low[1]
Close1= close[1]

Bulls1 = 0.5*(abs(Hi-Hi1)+(Hi-Hi1))
Bears1 = 0.5*(abs(Lo1-Lo)+(Lo1-Lo))

if Bulls1 > Bears1 then 
Bears=0
elsif Bulls1 = Bears1 then 
Bears=0
else
Bears=Bears1
endif

if Bulls1 < Bears1 then 
Bulls = 0
elsif Bulls1 = Bears1 then 
Bulls = 0
else
Bulls = Bulls1
endif 

if (barindex > 0) then 
sPDI = (Weighting*sPDI[1] + Bulls)/(Weighting+1)//ma weighting
sMDI = (Weighting*sMDI[1] + Bears)/(Weighting+1)//ma weighting
endif 
    
iTR = max(Hi-Lo,Hi-Close1)
if (barindex > 0) then 
STR  = (Weighting*STR[1] + iTR)/(Weighting+1)
endif 
  
if STR >0 then 
PDI=sPDI/STR
else
PDI=0
endif 

if STR>0 then 
MDI=sMDI/STR
else
MDI=0
endif 

if (PDI + MDI) > 0 then 
DX = abs(PDI - MDI)/(PDI + MDI)
else
DX=0
endif 

if (barindex > 0)then 
iADX = (Weighting*iADX[1] + DX)/(Weighting+1)
endif 
vADX = iADX

adxlow = lowest[ADXLength](iADX)
adxmax = highest[ADXLength](iADX)
ADXmin = min(1000000.0, adxlow)
ADXmax = max(-1.0, adxmax)
Diff = ADXmax - ADXmin

if Diff>0 then 
Const=(vADX- ADXmin)/Diff
else
Const=0
endif 

if (barindex > 0)then
VarMA=((2-Const)*VarMA[1]+Const*close)/2
endif 
MA= average[MALength](VarMA)

return MA as "FVMA"

Download
Filename: PRC_FantailVMA.itf
Downloads: 322
Nicolas
Nicolas Legend
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

xpe74
2 years ago
#

Bonjour Nicolas, quelle est la valeur de MA que l'on doit prendre en compte pour intégration dans une stratégie automatisée .... Merci pour le retour. Cordialement

Nicolas
2 years ago
#

Il faut faire un CALL de l'indicateur et y placé en paramètre les valeurs des périodes souhaitées.

FXtonio
3 years ago
#

Bonjour Nicolas, merci pour cette merveille, je l'utilise en compl2ment du "magical buy sell", 69% de trades gagnants en scalping m1-m5 Est il possible d'intégrer ces 2 indicateurs dans une stratégie automatique?

f1_maik
3 years ago
#

Ein sehr schöner Indikator, vielen Dank. Wenn ich den Indikator importiere und starte hat die Line keine Farben, sie ist einfach nur schwarz. Mache ich was falsch?

Nicolas
3 years ago
#

das ist in der Tat normal, Sie müssen die Auf- und Abwärtsfarbe direkt im Parameterfenster des Indikators ändern

ProRealCode ProRealCode
Loading...