Welcome Features News Download Registration Support FAQ Wish list Links
Advanced stock charting and analysis program

AFL Library

This is read-only version of AFL library entry. Ability to add user formulas and comment is only available from members-only area.

Details:

Formula name: Pivots And Prices
Author/Uploader: reinsley - (email hidden)
Date/Time added: 2010-01-02 13:12:09
Origin: // based on Pramod's comments http://www.amibroker.com/library/detail.php?id=617
Keywords: pivot
Level: basic
Flags: indicator

DISCLAIMER: Most formulas present in AFL on-line library are submitted by the users and are provided here on an "as is" and "as available" basis. AmiBroker.com makes no representations or warranties of any kind to the contents or the operation of material presented here. We do not maintain nor provide technical support for 3rd party formulas.
Description:

// pivots and prices
// based on Pramod\'s comments http://www.amibroker.com/library/detail.php?id=617
// adapted by Reinsley : Plot Prices on Pivot and ajustable digits #
// mod by Sanjiv Bansal : take care of Highs or Lows when two adjacent bars are equal
// does not reference to future

Formula:

// pivots and prices
// based on Pramod's comments
http://www.amibroker.com/library/detail.php?id=617
// adapted by Reinsley : Prices on Pivot and ajustable digits # 
// mod by Sanjiv Bansal : take care of Highs or Lows when two adjacent bars are
equal
// does not reference to future

SetChartOptions( 0, chartShowDates );

_SECTION_BEGIN( "Price" );
_N( Title = StrFormat( "{{NAME}} - {{INTERVAL}} {{DATE}} \nOp %g, \nHi %g, \nLo
%g, \nCl %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ) );
Plot( C, "Close", ParamColor( "Color", colorBlack ), styleNoTitle | styleCandle
 | styleThick );
_SECTION_END();

_SECTION_BEGIN( "pivot" );
price = ParamToggle( "Plot Price", "Off|On", 1 );
num = Param( "trend", 4, 1, 10, 1 );
dist = 0.5 * ATR( 10 );
rightfig = Param( "rightfig ", 7, 1, 10, 1 );
xspace = Param( "GraphXSpace ", 10, 1, 20, 1 );

mHHV = HHV( H, num );
mLLV = LLV( L, num );

FirstVisibleBar = Status( "FirstVisibleBar" );
Lastvisiblebar = Status( "LastVisibleBar" );

for ( b = Firstvisiblebar + num; b <= Lastvisiblebar AND b < BarCount -
        num; b++ )
{
    i = num;
    ml = 0;
    mu = 0;

    while ( i > 0 )
    {

        if ( L[b] < L[b+i] )
        {
            ml++;
        }


        if ( H[b] > H[b+i] )
        {
            mu++;
        }

        i--;
    }


    if ( ml == num AND L[B] == mLLV[B] )
    {
        PlotText( "\n *\n", b, L[b], colorGreen );

        if ( price == 1 )
        {
            p = StrRight( NumToStr( L[b], 4.1 ), rightfig );
            PlotText( "\n\n" + p, b - 2 , L[b] , colorGreen );
        }
    }


    if ( mu == num AND H[B] == mHHV[B] )
    {
        PlotText( " *\n", b, H[b], colorRed );

        if ( price == 1 )
        {
            p = StrRight( NumToStr( H[b], 4.1 ), rightfig );
            PlotText( p , b - 2 , H[b] + dist[b] + 1, colorRed );
        }
    }
}
_SECTION_END();

GraphXSpace = xspace;

Comments:

Pramod

2010-03-09 12:15:59
Thank you.
CC
cam_111000 [at] yahoo.com.au
2010-05-21 02:58:20
Thanks reinsley.

I wonder if you could create an EXPLORATION to identify the following pattern of low pivot points (LLP).

1. most recent LPP > previous LPP
2. previous LPP < LPP before that

...in other words, finding charts where a reverse head-and-shoulder pattern might exist.

Hope you can help!


About | Privacy | Terms of Use | Contact information
Copyright © 2001 AMIBROKER.COM