Skip to main content

Vortex Indicator w/ Histogram for Amibroker (AFL)

chaika about 16 years ago Amibroker (AFL)

  • Rating:
    5 / 5 (Votes 1)
  • Tags:
    oscillator, amibroker, histogram

The vortex indicator with histogram is similar to the ADX indicator, except that it combines pdi and mdi into one easy to read chart. Use in an indicator pane below the price chart.

Indicator / Formula

Copy & Paste Friendly
// Vortex Indicator 
// S&C Traders Tips Jan 2010 
period = Param("Period", 14, 2 ); 

VMP = Sum( abs( H - Ref( L, -1 ) ), period ); 
VMM = Sum( abs( L - Ref( H, -1 ) ), period ); 
STR = Sum( ATR( 1 ), period ); 

VIP = VMP / STR; 
VIM = VMM / STR; 

//Plot( VIP, "VI"+period+"+", colorBlue); 
//Plot( VIM, "VI"+period+"-", colorRed );


Hist      = VIP - VIM;
HistPrev  = Ref(Hist,-1);

Color = IIf(Hist>HistPrev,colorCustom9,
IIf(hist<HistPrev,colorRed,colorWhite));

Plot( Hist*1.02, "", color, styleDots+styleNoLine+styleNoLabel);
Plot( Hist*1.01, "", color, styleDots+styleNoLine+styleNoLabel);

Color = IIf(Hist>0,colorCustom11,
IIf(hist<0,colorCustom8,colorWhite));


Plot( Hist, "", color, styleHistogram+styleOwnScale+styleThick );

0 comments

Leave Comment

Please login here to leave a comment.