[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Inspection Points and Hi-pass Equity for the whole Market, part I



PureBytes Links

Trading Reference Links




The code will choose the top Equity stock at the 
Inspection Point [IP] and will trade all its [individual] signals up to the next 
inspection.
The procedure will be repeated for every future 
inspection.
The Equities at an inspection point are counted from the 
beginning of the available data.
All stocks should be aligned, missing bars should be filled 
before the research.
The starting and ending date for all stocks should be the 
same
The application is effective from Amibroker 4.44.1, Oct12, 
2003, when the 
SetForeign( ticker, fixup = True, tradeprices = 
False)
was implemented *
The selected stock at IP had an Equity value G. It is the 
ground level for the next trades and is plotted as a blue thick 
line.
Up to the next IP we may see if the selected top stock was 
profitable [Eq>G] or not [Eq<G].
The black line is the Equity from IP to IP.
How does it work : At the Inspection point X, for 
example, PETM was the top Equity stock [see PETM red equity 
line]
The code selected PETM and followed its trades up to now [PETM 
was the top stock for the next two IPs too !!]
 
// A Hi-pass Equity filter at the Inspection 
PointsSTART=DateNum()==1000530 ;Title="TOP EQ 
STOCK";EVENT=BarsSince(START)%101==0;Plot(2000,"",1,1);Plot(10000,"",Cum(1)%2,1);PlotShapes(shapeCircle*EVENT,colorRed);G=0;CountER=0;list 
= GetCategorySymbols( categoryGroup, 254 );// group IDfor( i = 0; ( sym = 
StrExtract( list, i ) ) != ""; i++ 
){SetForeign(SYM,True,True);global Buy;global 
Sell;Buy=Cross(StochD(),30);Sell=Cross(50,StochD());E1=Equity(1,0);E11=ValueWhen(EVENT,E1);T11=ValueWhen(EVENT,Cum(1));G=IIf(G>E11,G,E11);CountER=CountER+1;}Plot(G,"\nG",colorBlue,8);CountER1=0;D=0;list 
= GetCategorySymbols( categoryGroup, 254 );// group IDfor( i = 0; ( sym = 
StrExtract( list, i ) ) != ""; i++ 
){SetForeign(SYM,True,True);global Buy;global 
Sell;Buy=Cross(StochD(),30);Sell=Cross(50,StochD());E1=Equity(1,0);E11=ValueWhen(EVENT,E1);G11=ValueWhen(EVENT,G);D1=IIf(E11==G,CountER1,0);D=D+D1;EE=IIf(E11==G,E1,-1E10);Plot(EE,"",1,1);CountER1=CountER1+1;}Title=Title+" 
["+WriteVal(D,1.0)+"]"+WriteIf(EVENT," * 
","");SetForeign("PETM",True,True);Buy=Cross(StochD(),30);Sell=Cross(50,StochD());E0=Equity(1,0);Plot(E0,"",4,8);//Plot(D,"",1,styleOwnScale);
 
Notes
1. The 100 N100 stocks and the index ^NDX are placed in my 
Group254.
If your stocks are in the WatchList5, for example, you should 
change the // group ID lines as follows
 
list = GetCategorySymbols( categorywatchList, 5 
);//
 
2. The
Buy=Cross(StochD(),30);Sell=Cross(50,StochD());was 
used as example of the trading system.
Settings were arranged in AA window 
Buy, Sell at Open
Delay +1
commission 0.25%
all stops disabled
initial equity 10000
3. G [thick blue line] is the ground level, the equity value 
for the selected stock at the IP.
As you see, even for the top stocks, the system was not quite 
profitable, the [black] individual Equity lines 
are frequently below their Ground level G.
4. D is the ordinal # of the stock in the database. You may 
uncomment the last line to see the top Ds.
If you place your cursor on some bar, you will read D in the 
title.
An asterisk * will appear at each IP bar. As you 
see, on Oct20, 2000 the system sold #67 [NVDA] to buy
the new top stock #2 [ADBE] 
5. The graph is universal and will not change as you move from 
ticker to ticker in your symbol tree.
 
This is the basic idea, to ride on the top equity 
stock.
The expectation is a follow up, at least up to the next IP. 

If negative, the inspector will search for the new rising star 
of the show, right at the next IP !!
More details in part II, hopefully today...
Dimitris Tsokakis 
 
* From the 4.44.1 Readme.html




SetForeign( ticker, fixup = True, tradeprices = False) and 
RestorePriceArrays( tradeprices = False ) have new flag now: tradeprices 
(False by default)



when tradeprices is set to TRUE, then not only OHLC, V, OI, 
Avg arrays are set to foreign symbol values, but also BuyPrice, SellPrice, 
ShortPrice, CoverPrice, PointValue, TickSize, RoundLotSize, MarginDeposit 
variables are set to correspond to foreign 
security.



This allows Equity() to work well with 
SetForeign.






Yahoo! Groups Sponsor


  ADVERTISEMENT 









Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



Attachment:
IP1.gif

Attachment: Description: "Description: GIF image"