Amibroker AFL code for Volatility Breakout with Bollinger Bands:
Script:
//——————————————————————————
// Formula Name: Volatility Breakout with Bollinger Bands
// Author : www.marketsecrets.in
//——————————————————————————
Band= (BBandTop( C, 20, 2 ) – BBandBot( C, 20, 2)) / MA(Close, 20 ) * 100;
B= ((Close – BBandBot( Close, 20, 2 )) / (BBandTop( Close, 20, 2 ) – BBandBot( Close, 20, 2 ))) * 100;
Buy = band < 15 AND b > 95 AND MFI(10) > 60;
Sell = Cross(Close,SAR(0.01,0.2));
Short = band < 15 AND b < 5 AND MFI(10) < 40;
Cover = Cross(SAR(0.01,0.2), Close);
Filter = (band < 15 AND b > 95 AND MFI(10) > 60) OR (band < 15 AND b < 5 AND MFI(10) < 40);
NumColumns = 1;
Column0 = Close;