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

Re: [amibroker] Re: great p&f chart



PureBytes Links

Trading Reference Links

Looks like the counting logic has a flaw.  Compared to StockCharts, the number of X & O varies from being the same to off by one or more.  For example, take a look at the last five or so columns for $XAU.
 
Bill
----- Original Message -----
Sent: Monday, May 05, 2008 12:12 PM
Subject: RE: [amibroker] Re: great p&f chart

Yes, the Grid is a bit weird. I have tried to fix this backward parameter with no success, so I just live with it.
 
Donald F Lindberg
 


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of droskill
Sent: Monday, May 05, 2008 8:59 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: great p&f chart

I think this code is almost great - my issue with it is that the grid
appears or disappears depending on where I click on the chart. This
is with the show grid setting to "no" in the parameters (I'm also not
sure why the parameter would be "no" to show the grid and "yes" to not
show the grid.

Anybody have a way around this?

--- In amibroker@xxxxxxxxxps.com, "Don Lindberg" <dlindber@xx.> wrote:
>
> I have used the AFL code below with good success. Don't know if it will
> satisfy you, but give it a try.
>
> Donald F Lindberg
>
> ------------------------- Begin Code
---------------------------------------
> _SECTION_BEGIN( "Point & Figure w Values adj" );
>
> GraphXSpace = 5;
>
> SetChartBkColor( ParamColor( "BackGroundColor", colorBlack) );
>
> //GraphColor = ParamColor("GarphColor",colorLightGrey);
>
> GridColor = ParamColor( "GridColor", colorLightGrey );
>
> Scaling = ParamList( "Scaling Method", "Traditional|Percentage|AVG True
> Range" );
>
> if ( scaling == "Traditional" )
>
> Box = Param( "Box", 1, 0.2, 10, 0.1 );
>
> else
>
> if ( scaling == "Percentage" )
>
> Box = Param( "Box ", 1, 0.2, 10, 0.1 ) / 100 * LastValue( C );
>
> else
>
> if ( scaling == "AVG True Range" )
>
> Box = Param( "Box", 1, 0.3, 5, 0.1 ) * LastValue( ATR ( 20 ) );
>
> shiftChart = 0;
>
> shiftLastClose = 1;
>
> shiftGrid = 7;
>
> shiftPriceAxis = 2;
>
> Reverse = Param( "Reverse", 3, 1, 5 );
>
> j = 0;
>
> PFL[0] = Box * ceil( Low[0] / Box ) + Box;
>
> PFH[0] = Box * floor( High[0] / Box );
>
> direction = 0;
>
> for ( i = 1; i < BarCount; i++ )
>
> {
>
> if ( direction[j] == 0 )
>
> {
>
> if ( Low[i] <= PFL[j] - Box )
>
> {
>
> PFL[j] = Box * ceil( Low[i] / Box );
>
> }
>
> else
>
> {
>
> if ( High[i] >= PFL[j] + Reverse*Box )
>
> {
>
> j++;
>
> direction[j] = 1;
>
> PFH[j] = Box * floor( High[i] / Box );
>
> PFL[j] = PFL[j - 1] + Box;
>
> }
>
> }
>
> }
>
> else
>
> {
>
> if ( High[i] >= PFH[j] + Box )
>
> {
>
> PFH[j] = Box * floor( High[i] / Box );
>
> }
>
> else
>
> {
>
> if ( Low[i] <= PFH[j] - Reverse * Box )
>
> {
>
> j++;
>
> direction[j] = 0;
>
> PFH[j] = PFH[j - 1] - Box;
>
> PFL[j] = Box * ceil( Low[i] / Box );
>
> }
>
> }
>
> }
>
> }
>
> delta = BarCount - j - 1;
>
> direction = Ref( direction, - delta );
>
> Hi = Ref( PFH, -delta ) + Box / 2;
>
> Lo = Ref( PFL, -delta ) - Box / 2;
>
> Cl = IIf( direction == 1, Hi, Lo );
>
> Op = IIf( direction == 1, Cl - Box, Cl + Box );
>
> Graphcolor = IIf( direction == 1, ParamColor( "X_Color",
colorBrightGreen ),
>
> ParamColor( "O_Color", colorRed ) );
>
> PlotOHLC( Op, Hi, Lo, Cl, "", GraphColor ,
>
> stylePointAndFigure | styleNoLabel, 0, 0 , shiftChart );
>
> PlotOHLC( Op, Hi, Lo, Cl, "", GraphColor , stylePointAndFigure |
> styleNoLabel, 0, 0 , shiftChart );
>
> Last = Ref( LastValue( C ), -( BarCount - 1 ) );
>
> Plot( Last, "", colorRed, styleNoLine | styleDots, 0 , 0,
shiftLastClose );
>
> // selected value
>
> Value = IIf( direction > 0, SelectedValue( Hi ) - box / 2,
SelectedValue( Lo
> ) + box / 2 );
>
>
//----------------------------------------------------------
>
> // GRID CONSTRUCTION
>
> //----------------------------------------------------------
>
> PlotGridLines = ParamToggle( "PlotdGrid", "Yes! |No", 1 ) ;
>
> if ( PlotGridLines )
>
> {
>
> begin = SelectedValue( BarIndex() );
>
> end = LastValue( BarIndex() );
>
> period = end - begin + 1;
>
> if ( begin < end )
>
> {
>
> ScreenHigh = LastValue( HHV( cl, period ) );
>
> ScreenLow = LastValue( LLV( Cl, period ) );
>
> top = LineArray( begin - shiftGrid, screenHigh, end, screenhigh, 0 ,
1 );
>
> Bot = LineArray( begin - shiftGrid, screenlow, end, screenLow, 0, 1 );
>
> Plot( top, "", gridColor, styleLine | styleNoLabel , 0, 0, shiftGrid );
>
> //Plot( bot, "", gridColor,styleLine|styleNoLabel, 0 , 0 , shiftGrid);
>
> VerticalGrid = IIf ( BarIndex() >= begin, IIf( direction == 1,
screenHigh,
> screenLow ), Null );
>
> Plot ( VerticalGrid, "", gridColor, styleStaircase | styleNoLabel,
0, 0, 1
> );
>
> format = 8.2;
>
> for ( n = LastValue( bot ); n < LastValue( top ) - 0.5*box; n = n +
box )
>
> {
>
> Plot( bot , "", gridColor, styleLine | styleNoLabel, 0, 0 , shiftGrid );
>
> text = NumToStr( LastValue( bot ) + 0.5 * box, format );
>
> xposition = BarCount + shiftPriceaxis;
>
> yPosition = LastValue( bot ) + 0.27 * box;
>
> PlotText( text, xPosition , yPosition, colorBlue );
>
> bot = bot + box;
>
> Graphcolor = IIf( direction == 1, ParamColor( "X_Color",
colorBrightGreen ),
>
> ParamColor( "O_Color", colorRed ) );
>
> PlotOHLC( Op, Hi, Lo, Cl, "", GraphColor ,
>
> stylePointAndFigure | styleNoLabel, 0, 0 , shiftChart );
>
> }
>
> }
>
> }
>
>
>
> //----------------------------------------------------------
>
> // TITLE
>
> //----------------------------------------------------------
>
> Title = "\n" +
>
> " Instrument : " + Name() + FullName() + "\n " +
>
> "Formula : " + " Point & Figure (High/Low Range)" + "\n " +
>
> "Box : " + NumToStr( Box, 4.4 ) + " " +
>
> "Reverse : " + NumToStr( Reverse, 2.0 ) + "\n " +
>
> "ATR : " + WriteVal( LastValue( ATR( 100 ) ), format = 4.4 );
>
> _SECTION_END();
>
> ------------------------ End Code -------------------------
>
>
>
>
> _____
>
> From: amibroker@xxxxxxxxxps.com [mailto:amibroker@xxxxxxxxxps.com]
On Behalf
> Of rr_bt
> Sent: Sunday, May 04, 2008 1:10 AM
> To: amibroker@xxxxxxxxxps.com
> Subject: [amibroker] great p&f chart
>
>
>
> hello,
>
> i'm new to amibroker. checked out the p&f charts from the afl library.
> copied them into ab but i found the charts difficult to read.
>
> i'm looking for a chart like this one
> http://stockcharts. <http://stockcharts.com/def/servlet/SC.pnf?c=ibm,P>
> com/def/servlet/SC.pnf?c=ibm,P which has some timing
> references (year on the bottom axis and month reflected in the chart
> symbols).
>
> just wondering if it would be possible to code the stockcharts.com
> chart in amibroker afl? how difficult?
>
> i trialed bull's eye broker product but couldn't get it to work with ab
> data (supposed to read ab data directly).
>
> my preference is to have the p&f code in ab so its nicely integrated.
> thanks.
>


No virus found in this incoming message.
Checked by AVG.
Version: 7.5.524 / Virus Database: 269.23.8/1414 - Release Date: 5/4/2008 12:31 PM
__._,_.___

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




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___