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

[amibroker] Re: STOPs / Exit anybody?



PureBytes Links

Trading Reference Links




 
Step1.

Create  the "~OUT1" composite ticker for the N100 
market.
KUP and KDOWN are the Keltner Resistance/Support, the 
condition OUT1 occurs when a stock closes 
below the Keltner support for the first 
time.
The "~OUT1" counts how many tickers did it. 
 
// OUT1
// scan the N100 database for all 
quotationsKUP=EMA((H+L+C)/3,10)+EMA(H-L,10);KDOWN=EMA((H+L+C)/3,10)-EMA(H-L,10);OUT1=C<KDOWN 
AND 
Ref(C,-1)>Ref(KDOWN,-1);AddToComposite(OUT1,"~OUT1","V");AddToComposite(1,"~COUNT","V");Buy=0;
 
Step2.

After creating the composite ticker, paste in IB 
the
 
// BUY ARROWS
X1=Foreign("~out1","V");Filter=Ref(x1,-1)>20 AND 
x1<10;SetForeign("^NDX");Plot(C,"",1,64);PlotShapes(shapeUpArrow*Filter,colorBrightGreen);GraphXSpace=5;
 
It will plot a green arrow when the "~OUT1" changes 
dramatically from >20 to <10.
The signals are quite reliable for the recent bullish period, 
the delays are not bad and may give hints for the re-entry points.
[see Fig. 1]
 
Step3.

After creating the "~out1" composite, let us see the highest 
possible profit for a N100 stock.The daily function p1 resets to 0 at every 
buy bar and gives the highest partial profit from arrow to arrow.Paste in an 
IB window the 
 
// Highest individual 
profitX1=Foreign("~out1","V");Filter=Ref(x1,-1)>20 AND 
x1<10;PlotShapes(shapeUpArrow*Filter,colorBrightGreen);p1=100*(-1+H/Ref(O,-BarsSince(Filter)));Plot(0,"0",colorBlack,1);Plot(p1,"p1",IIf(p1>0,colorBrightGreen,colorRed),8+2);
 
Select a N100 ticker from the symbol tree to see the 
individual profits per period.
[See Fig. 2]
 
Step4.

To see the % of the profitable stocks for the whole N100 
database:
 
// Create the average p1
// scan the N100 database for all 
quotations  
X1=Foreign("~out1","V");Filter=Ref(x1,-1)>20 AND 
x1<10;p1=100*(-1+H/Ref(C,-BarsSince(Filter)));AddToComposite(p1,"~p1","C");AddToComposite(p1>0,"~profitable","v");Buy=0;
 
Step5.
 
// The average p1 
graphX1=Foreign("~out1","V");Plot(0,"0",colorBlack,1);Plot(-10,"",1,1);Filter=Ref(x1,-1)>20 
AND 
x1<10;//Plot(C,"",1,64);PlotShapes(shapeSmallUpTriangle*Filter,colorBrightGreen); 
pAV=Foreign("~p1","C")/Foreign("~count","v");Profitables=100*Foreign("~profitable","v")/Foreign("~count","v");Plot( 
5, "Ribbon",IIf( profitables>90, colorBlue,IIf(profitables>75, 
colorLightBlue,IIf(profitables>50,colorYellow,colorRed))), 
styleArea|styleNoLabel|styleOwnScale,-1,100 
);Plot(IIf(Filter,0,pAV),"pAV",IIf(pAV>0,colorBlack,colorRed),styleArea);Title="The 
"+WriteVal(profitables,1.0)+"% of the N100 stocks is profitable. The Average 
Profit since "+WriteVal(ValueWhen(Filter,DateTime()),formatDateTime)+" is 
"+WriteVal(pAV,1.2)+"%";Plot(HighestSince(Filter,IIf(Filter,0,pAV)),"",ColorLightGrey,1);
 

The profitability is, according to the ribbon color>90% 
[Blue]>75% [LightBlue]>50% [yellow]<50% [red]
You may read in the title the % of profitable stocks and the highest 
possible average profit from the Buy date.
[See Fig. 3]
 
Dimitris Tsokakis


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








Yahoo! Groups Sponsor


  ADVERTISEMENT 












Yahoo! Groups Links
To visit your group on the web, go to:http://groups.yahoo.com/group/amibroker/ 
To unsubscribe from this group, send an email to:amibroker-unsubscribe@xxxxxxxxxxxxxxx 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.







Attachment:
1PI.gif

Attachment: Description: "Description: GIF image"