Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Bollinger Bands Trading System Intraday for Amibroker (AFL)
mjoger
almost 10 years ago
Amibroker (AFL)

Rating:
2 / 5 (Votes 7)
Tags:
trading system, amibroker, bands

Trading System for Bollinger Bands (especially for intraday data)
Good results for 5 , 3 and 1 minutes periods.

Indicator / Formula

Copy & Paste Friendly
///Mjoger Bollinger System 1.1
//best results for 5 - and 1 - minutes periods

Stop_Profit = Optimize( "profit point", 0, 0, 40, 1 );   

BollingerPeriods = Optimize( "period bollinger", 16, 3, 25, 1 );   

BollingerWidth = Optimize( "width bollinger", 3, 1, 4, 1 );   

LevelAboveBandTop = Optimize( "above band", 50, 0, 100, 25 );   

RSISIGNAL = Optimize( "rsi signal", 7, 2, 20, 1 );   
   
ApplyStop(stopTypeTrailing, stopModePoint, Stop_Profit, 0, False, 0);   

 
BuyShortPosition = Close>BBandTop(Close, BollingerPeriods,BollingerWidth ) || Open>BBandTop(Close, BollingerPeriods,BollingerWidth )
							 || High>BBandTop(Close, BollingerPeriods,BollingerWidth );

//for backtesting = buy only one contract/share

PositionSize = MarginDeposit = 1;


BuyShortPositionPriceSignalPercent = 0;

diffCloseOpen = abs(Close-Open);
diffCloseBollingerTop = abs(Close-BBandTop(Close, BollingerPeriods,BollingerWidth ));

BuyShortPositionPriceSignalPercent = IIf( Close<BBandTop(Close, BollingerPeriods,BollingerWidth ) &&  Open<BBandTop(Close, BollingerPeriods,BollingerWidth ), 100,


(diffCloseBollingerTop /diffCloseOpen)*100

);


BuyLongPosition = Close<BBandBot(Close, BollingerPeriods,BollingerWidth ) || Open<BBandBot(Close, BollingerPeriods,BollingerWidth )
							 || High<BBandBot(Close, BollingerPeriods,BollingerWidth );


BuyLongPositionPriceSignalPercent = 0;

diffCloseOpen = abs(Close-Open);
diffCloseBollingerBottom = abs(Close-BBandBot(Close, BollingerPeriods,BollingerWidth ));

BuyLongPositionPriceSignalPercent  = IIf( Close<BBandBot(Close, BollingerPeriods,BollingerWidth ) &&  Open<BBandBot(Close, BollingerPeriods,BollingerWidth ), 100,
//else

(diffCloseBollingerBottom /diffCloseOpen)*100

);

BelowBollingerBand = BuyLongPositionPriceSignalPercent  >= LevelAboveBandTop ;


AboveBollingerBand  = BuyShortPositionPriceSignalPercent >= LevelAboveBandTop ;


Buy=BuyLongPosition && BelowBollingerBand && RSI(RSISIGNAL ) <40 ;

Sell=0;//RSI(RSISIGNAL ) > 90;
 
Short=BuyShortPosition && AboveBollingerBand && RSI(RSISIGNAL ) >80  ; 
 
Cover=0;//RSI(RSISIGNAL ) < 10 ; 


Plot( BBandTop(Close, BollingerPeriods,BollingerWidth ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style")  );
Plot( BBandBot(Close, BollingerPeriods,BollingerWidth ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style")  );

Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 

PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorGreen, 0, Close, 0);
PlotShapes(IIf(Sell , shapeDownArrow, shapeNone),colorRed, 0, Close, 0);

PlotShapes(IIf(Short , shapeDownTriangle, shapeNone),colorBrightGreen, 0, Close, -5);
PlotShapes(IIf(Cover , shapeUpTriangle, shapeNone),colorBlue, 0, Close, -5);

2 comments

1. sa

it is just a band…any signal?

2. projsx

could you plot/displaying the middle line?

Leave Comment

Please login here to leave a comment.

Back