PureBytes Links
Trading Reference Links
|
Try this ... it works for me.
// Breadth of Stocks
// Develops 4 composites that can be plotted or manipulated as you wish
// How to Run
// 1) Select Group - Stocks or Market -NYSE,Nasdq, AMEX
// 2) Select an issue with a long history in the current ticker window
// 3) Set APPLY TO to use filter Market - Stocks
// 4) Set RANGE to one bar... 1 n last quotations
// 5) Press SCAN
//===================52 Weeks New High
-Lows==================================
NHi = (C> HHV(Ref(C,-1),251));
NLo = (C< LLV(Ref(C,-1),251));
AddToComposite(IIf(C > HHV(Ref(C, -1), 251), 1,0), "~StocksNewHi",
"X"); //Find New Highs over the past 52 weeks.
AddToComposite(IIf(C < LLV(Ref(C, -1), 251), 1,0), "~StocksNewLo",
"X"); //Same for lows next.
NewHigh = Foreign("~StocksNewHi","X");
NewLow = Foreign("~StocksNewLo","X");
DIFF_H_L = NewHigh-NewLow;
//Plot(NewHigh,"NewHigh",colorGreen,styleThick);
//Plot(NewLow,"NewLow",colorRed,styleThick);
//Plot(Diff_H_L,"Diff_H_L",colorPlum,styleThick);
//===================Advance/Decline Issues
AddToComposite(C>Ref(C,-1),"~StocksAdv","X");
AddToComposite(C<Ref(C,-1),"~StocksDec","X");
AddToComposite(C==Ref(C,-1),"~StocksNC","X");
Adv = Foreign("~StocksAdv","X");
Dec = Foreign("~StocksDec","X");
NC =Foreign ("~StocksNC","X");
DIFF_A_D = Adv-Dec;
ADRatio = IIf(Dec>Adv,(Dec*-1)/Adv,Adv/Dec);
Plot(Adv,"Adv",colorBlack,styleLine);
Plot(Dec,"Dec",colorBrown,styleLine);
//Plot( Adv-Dec, "Adv/Dec Histogram", IIf(Adv-Dec >
0,colorBrightGreen,colorRed ), styleNoTitle | ParamStyle("Histogram
style", styleHistogram | styleNoLabel, maskHistogram ));
//Plot(Diff_A_D,"Diff_A_D",colorBlack,styleThick);
Plot(ADRatio,"AdvanceDeclineRatio",colorDarkBlue,styleHistogram);
Plot (Cum(Adv-Dec),"Diff_A_D",colorBlack,styleDots);
GraphXSpace = 2;
Filter = C;
Buy = Sell = 0;
Result = WriteIf(Buy,"Buy","Sell");
//AddTextColumn( WriteIf(Buy, "Buy" , "Sell" ) , "TRADE" , 5 ,
IIf(Buy,colorYellow, colorWhite), IIf(Buy, colorDarkGreen,
colorDarkRed) );
AddTextColumn(Result,"Trade",
formatChar,IIf(Buy,colorDarkGreen,colorLightYellow ),
IIf(Sell,colorLightYellow,colorLime));
//AddTextColumn(Result,"Trade",
formatChar,IIf(Buy,colorDarkGreen,colorRed ),
IIf(Sell,colorLightYellow,colorLime));
AddTextColumn(FullName(),"Full name",77,colorPlum, IIf(Close
<1.00,colorYellow,colorDefault ) );
AddTextColumn(IndustryID(1) ," Industry Sector ", 25.0,
colorWhite, colorBlue);
AddColumn( Close, "Close", 1.2, IIf( ROC(C, 1 ) >= 0,
colorDarkGreen,colorRed ),50 );
AddColumn(NHi,"52 Wk High",1.2,colorBrown);
AddColumn(NLo,"52 Wk Low",1.2,colorDarkBlue);
//AddColumn ((NHi-NLo/NHi)*100,"% Dif Hi_Lo", 3.2,
colorYellow,colorGreen);
AddColumn( ( (HHV(C,251))-LLV(C,251))/(HHV(C,251))*100,"% Dif Hi_Lo",
3.2, colorYellow,colorGreen);
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
_SECTION_END();
Watch for "wrap around" when pasting formula.
Dick H.
--- In amibroker@xxxxxxxxxxxxxxx, Waleed Khalil <waleedkhalil@xxx> wrote:
>
> Dear all
> I have been trying for two days to make the AD ratio , but did not
> succeed. any help on that please.
> thanks in advance
> Waleed
>
------------------------------------
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/amibroker/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:amibroker-digest@xxxxxxxxxxxxxxx
mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|