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

Stocks trading in a tight range EXPLORATION AFL for Amibroker (AFL)
cnbondre
about 14 years ago
Amibroker (AFL)

Rating:
3 / 5 (Votes 4)
Tags:
amibroker, exploration

HERE IS A SMALL CODE USEFULL FOR INTRADAY AS WELL AS FOR EOD
You may want to try the code below to find stocks that are trading in a range OR band.
The idea is to take a look at the Highest closing price AND the Lowest closing price over x days, determine how tight that trading range has been.
I Use the code to find breakouts (UP/DOWN) from these ranges.

Note to newbies: THIS IS AN EXPLORATION CODE WILL NOT PRODUCE A CHART.

Similar Indicators / Formulas

Three Day Balance Points
Submitted by nvkha almost 10 years ago
Deel - Average Dollar Price Volatility
Submitted by kaiji over 14 years ago
DIX50,20,10
Submitted by morgen almost 14 years ago
4-Day-Range Switch
Submitted by santho_sd almost 14 years ago

Indicator / Formula

Copy & Paste Friendly
//Stocks trading in a tight range 
//You may want to try the code below to find stocks that are trading in a range OR band.
//The idea is to take a look at the Highest closing price AND the Lowest
//closing price over x days, determine how tight that trading range has been.
//I Use the code to find breakouts (UP/DOWN)from these ranges.

RP = Param("Trading Range Period" , 30, 10, 240, 1);
MRB = Param("Max Range Band in %" , 20, 1, 30, 1);

// Calculate the trading Range Band ------------ --
RBH = Ref(HHV(Close, RP), -1); // Highest Close over Range Period
//(Preceeding RP days)
RBL = Ref(LLV(Close, RP), -1); // Lowest Close over Range Period
//(Preceeding RP days)
RBP = ((RBH - RBL) / RBH) * 100; // Range Band in percentage
IRB = RBP <= MRB; // Range Band % less than Max RB %
CBRup = C > RBH; // Close above Range Band?
CBRdn = C < RBL; // Close above Range Band?

Filter=IRB AND (CBRup OR CBRdn);

AddColumn(IIf(IRB,RBP,Null) , "RBP" , 3.2, colorWhite, colorDarkYellow, 50); 
AddColumn(IIf(CBRup,1,IIf(CBRdn,-1,Null)) , "C" , 3.2, colorWhite,IIf(CBRup,colorDarkGreen,IIf(CBRdn,colorDarkRed,Null)), 50); 

7 comments

1. hossain123

It’s not working. The pane appears blank.

2. administrator

That’s because it is an exploration only.

3. cnbondre

Hi,

Admin,
Thanks for reply,
This is a reliable exploration afl. Useful for filtering stocks, ready for break-out(up/down) or a limited risk can be taken for short-term trade/intraday.

cnbondre

4. rspuar

Good Work,
I Was Coding This Code From Few Days, But Not Successfully Coded. While Searching References For The Code I Accidently Found This One. Good Work & Thanx

5. bhawnaahuja

Very Good Afl
Buy after breaking if the range the stocks break then if once again the stocks enter in the same range the signal disappear
Please work over it, very fantastic afl but due this reason

6. bhawnaahuja

Can AnyOne help adding the false breakout/Failed Signals generated during run time with this code be also included in the filter results with added column—>> Passed/Failed

7. darek69

Super Afl sir

Leave Comment

Please login here to leave a comment.

Back