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

Buy at an Extreme Low Point for Amibroker (AFL)

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

Based on an idea by Nat Stewart in Active Trader Magazine, December 2012:
The Low Close Edge
Stewart presented several different versions of the low-close strategy in the article, but I generalized it for this snippet of a trading program.
The concept is simple: buy the stock when it closes in the bottom NperIn% of its daily range,
AND in the bottom NperIn% of its LookBackIn day range.
When it closes in the top NperOut% of its daily range
AND in the top NperOut% of its LookBackOut day range, liquidate the position and return to cash.

Similar Indicators / Formulas

EMA crossover
Submitted by Ketan-0 about 13 years ago
Kase Peak Osc. V2 batu
Submitted by batu1453 almost 10 years ago
Kase CD V2batu
Submitted by batu1453 almost 10 years ago
Ichimoku
Submitted by prashantrdx almost 10 years ago
buy and sell two EMAS
Submitted by mundo0007 about 12 years ago
Adaptive Price Zone (APZ)
Submitted by AndrewThomas about 13 years ago

Indicator / Formula

Copy & Paste Friendly
NperIn = Optimize("NPerIn", 10, 10, 40, 5); /* The close has to be less than this % of its daily and N day range */
LookBackIn = Optimize("LookBackIn", 17, 5, 21, 1); /*LookBack Period of Days for Close % determination */

LExitDays = Optimize("LExitDays", 5, 1, 30, 1);
SExitDays = Optimize("SExitDays", 5, 1, 30, 1);

/* */

NperOut = 2* NperIn;/* The close has to be less than this % of its daily and N day range */
LookBackOut = LookBackIn/2; /*LookBack Period of Days for Close % determination */
IndexLen =200;
/*****************************************************************************************************************/   
//Indicator #1 - On the Current Bar, what % is the Close
Condition1 =  (100 * (C-L) / (H-L)) < NperIn;
Condition10 = (100* (C-L) / (H-L)) > 100-NperOut;
//Indicator #2 - In the past Len1 days,  
Condition2 =  100 * (C - LLV(L,LookBackIn)) / (HHV(H,LookBackIn) - LLV(L,LookBackIn)) < NperIn;
Condition20=  100 * (C - LLV(L,LookBackOut)) / (HHV(H,LookBackout) - LLV(L,LookBackout)) >100- NperOut;

//Indicator #4 - Long Term Market
StrongTrendUp =   Close > MA(Close, IndexLen) AND MA(Close,IndexLen) > Ref(MA(Close,IndexLen),-1) ;
StrongTrendDn =   Close < MA(Close, IndexLen/4)   AND MA(Close,IndexLen/4) < Ref(MA(Close,IndexLen/4),-1) ;
TrendLess = NOT(StrongTrendDn OR StrongTrendUp);
/*****************************************************************************************************************/  
Buy =  Condition1 AND Condition2  AND NOT StrongTrendDn; 

Short = False;    
Sell= Ref(Buy, -LExitDays) OR Short OR (Condition10 AND Condition20) ;    
Buy= ExRem(Buy, Sell);     
Sell= ExRem(Sell, Buy) ;
    
Cover=Ref(Short, -SExitDays) OR Buy OR (Condition1 AND Condition2);     
Short= ExRem(Short, Cover);     
Cover= ExRem(Cover, Short);     
    

9 comments

1. hotaro3

gives error at lines 24 and 28 due to no definition for LExitDays and SExitDays

2. isc0rpi0

giving error at lines 24/28 kindly fix that thanks

3. godisbogus

Formula is incomplete.

4. satish1b

Not Working sir
giving error

5. administrator

Formula fixed.

6. RBuck

Interesting approach . . . when I added my standard optimization, walk-forward and stop loss routines the approach, it provided a better than 30% annualized return for a 2 month train, 2 month step walk-forward 2011 – 2012 against a 3 position portfolio of the current IBD Top Fifty.

Unusual was the overall return . . . of the 464/848 trades all were long, average days held were 2.22, maximum trade % draw-down -17%, maximum system % draw-down -18%.

I consider better than 30% annual return on out-of-sample test, outstanding. Good work. by grace, RBuck

7. samkum

Nothing shown… only blank screen… help needed..

8. sutharnehal

it shows blank white screen, seems something is wrong with the code. please fix.

9. santosh

dont post this type of indicator without testig it

Leave Comment

Please login here to leave a comment.

Back