// Downloaded From https://www.WiseStockTrader.com
/*---------------------------------------------------------------------------------------------------------------------------------------------------------------
I found Vortex on https://www.wisestocktrader.com 
I have added some calculations to generate ADX from it. It is smooth but sensitive.
.
1) Rising ADX of Vortex  from 10 to 15 is trend building area to be noticed.
.
2) Cross of Vi-Plus and VI-Minus is similar to MDI & PDI so when blue line goes above orange/red it is buy signal and visa-versa. 
.
3) If ADX of Vortex  is falling but above 10 and below 15 avoid trade in such case because even if signal is generated by cross over of  Vi-Plus and VI-Minus it may not give good profit.
.
4) Once the position is taken and Price is steady but ADX of Vortex is falling then keep eye on cross over of  Vi-Plus and VI-Minus to exit from trade.
.
5) VI-Minus is also plotted in histogram mode so bearish trend can be noticed quickly. 
.
ADX of Vortex by Mr. Abhimanyu Yashwant Altekar Email@abhimanyu.altekar@gmail.com
 ----------------------------------------------------------------------------------------------------------------------------------------------------------------*/



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; 

DIDif=abs(VIP-VIM)*10;
DISum=(VIP+VIM)*10;
ADXofVortex=100*Wilders(DIDif/DISum,period);  
Plot( VIP*10, "VI-Plus"+period, colorBlue | styleThick ); 
Plot( VIM*10, "VI-Minus"+period, colorRed  );
Plot( VIM*10, "", colorOrange , styleClipMinMax |  styleNoLabel | styleHistogram  );
Plot(ADXofVortex,"ADX of Vortex", colorBlack, styleThick | styleLine);
Plot(15,"",colorBlack,styleDashed   );
Plot(10,"",colorBlack,styleDashed   );


 
_SECTION_END();