Skip to main content

Lentz Volatility Indicator for Amibroker (AFL)

ronlon about 9 years ago Amibroker (AFL)

  • Rating:
    3 / 5 (Votes 2)
  • Tags:
    amibroker

The Lentz Volatility Indicator is an inverted histogram of the difference between the 20-day ATR and its 20-day EMA. It can help discern environments conducive for non-directional option premium selling.

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("$LVI");
//Lentz Volatility Indicator

period = Param("EMA Period", 20, 1, 200, 1 );
ATRperiod = Param("ATR Period", 20, 1, 200, 1 );

SetForeign("^GSPC"); 
LVI = 0-(ATR(ATRperiod)-EMA(ATR(ATRperiod),period));
RestorePriceArrays();

Plot( LVI, _DEFAULT_NAME(), IIF(LVI>0, colorGreen, colorRed), styleHistogram );
Plot( LVI, "", colorblack, styleLine | styleNoLabel);

Plot(0,"",colorBlack,styleDashed | styleNoLabel);

_SECTION_END();

3 comments

almost 7 years ago
_SECTION_BEGIN("$LVI");
//Lentz Volatility Indicator
 
period = Param("EMA Period", 20, 1, 200, 1 );
ATRperiod = Param("ATR Period", 20, 1, 200, 1 );
 
SetForeign("^GSPC"); 
LVI = 0-(ATR(ATRperiod)-EMA(ATR(ATRperiod),period));
RestorePriceArrays();
 
Plot( LVI, _DEFAULT_NAME(), IIF(LVI>0, colorRed, colorGreen), styleHistogram );
Plot( LVI, "", colorblack, styleLine | styleNoLabel);
 
Plot(0,"",colorBlack,styleDashed | styleNoLabel);
 
_SECTION_END();

//Please use it and understand Lentz Volatility Indicator when Line below Zero //Line Investor enter and stock rising.
//I just change Color as below
//Plot( LVI, _DEFAULT_NAME(), IIF(LVI>0, colorRed, colorGreen), styleHistogram );
almost 7 years ago
_SECTION_BEGIN("$LVI");
//Lentz Volatility Indicator
 
period = Param("EMA Period", 20, 1, 200, 1 );
ATRperiod = Param("ATR Period", 20, 1, 200, 1 );
 
SetForeign("^GSPC"); 
LVI = 0-(ATR(ATRperiod)-EMA(ATR(ATRperiod),period));
RestorePriceArrays();
 
Plot( LVI, _DEFAULT_NAME(), IIF(LVI>0, colorRed, colorGreen), styleLeftAxisScale );
Plot( LVI, "", colorblack, styleLine | styleLeftAxisScale);
 
//Plot(0,"",colorBlack,styleDashed | styleNoLabel);
 
_SECTION_END();
Plot(0,"",colorGold,styleDashed | styleLeftAxisScale);


_SECTION_END();

//Use it in Main AFL see result. I.m using in Day trading..

Leave Comment

Please login here to leave a comment.