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

[amibroker] Re: AdvIssues



PureBytes Links

Trading Reference Links

You can get them from you own database especially if you are using the US-Stocks database.  Here's the code:
// 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 (or all stocks/ETF's)
// 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|styleHistogram); 
Plot(NewLow*-1,"NewLow",colorRed,styleThick|styleHistogram); 
Plot(0,"",1); 


//===================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();

--- In amibroker@xxxxxxxxxxxxxxx, malcolm Crouch <malcolm.croucher@xxx> wrote:
>
> Hi ,
> 
> I am trying to plot the advissues : i show the code below .
> 
> Actually I would like to learn how to use this fucntion but the help does
> not give you much ...... so im messing around ... but dont seem to be able
> to get to far .
> 
> any suggestions ?
> 
> Regards
> 
> Malcolm
> 
> Code :
> 
> ----------------------------------------
> 
> /*
> Absolute Breadth Index
> AFL implementation by Tomasz Janeczko.
> 
> */
> 
> Graph0 = abs( AdvIssues() - DecIssues() );
> Plot(Graph0,"name", ParamColor( "Color", colorCycle ), ParamStyle("Style")
> );
> ---------------------------------------
> 
> 
> 
> -- 
> Malcolm A.B Croucher
>




------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

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/