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

Re: [amibroker] UserKB BAR LABELING enhancements trouble



PureBytes Links

Trading Reference Links

Title: Re: [amibroker] UserKB BAR LABELING enhancements trouble

Try this, i also added week day names:


_SECTION_BEGIN( "BAR LABELING" );

Plot(C,"",1,128);

ShowBars = ParamToggle( "Label Bars", "NO|YES", 0 );

LabelCo = ParamColor( "Label", colorYellow );

Label = ParamList( "BarLabel", "NUMBER|TimeNum|DateNum|BARNUM|WEEKDAYNUM|WEEKDAY", 0 );

GraphXSpace = 10;


if ( Showbars )

{

    DN = DateNum();

    TN = TimeNum();

    WD = DayOfWeek();

    WDList = "SUN,MON,TUE,WED,THU,FRI,SAT";

    FirstVisibleBar = Status( "FirstVisibleBar" );

    Lastvisiblebar = Status( "LastVisibleBar" );


    for ( b = Firstvisiblebar, BN = 0; b <= Lastvisiblebar AND b < BarCount;

            b++ )

    {

        if ( Label == "NUMBER" )

            BarLabel = NumToStr( BN++, 1.0 );

        else

            if ( Label == "TIMENUM" )

                BarLabel = NumToStr( TN[b], 1.0 );

            else

                if ( Label == "BARNUM" )

                    BarLabel = NumToStr( b, 1.0 );

                else

                    if ( Label == "WEEKDAYNUM" )

                        BarLabel = NumToStr( WD[b], 1.0 );

                    else

                        if ( Label == "WEEKDAY" )

                            BarLabel = StrExtract( WDList, WD[b] );

                        else

                            BarLabel = NumToStr( DN[b], 1.0 );


        PlotText( "\n^\n" + BarLabel, b, L[b] - ( H[b] - L[b] ), LabelCo );

    }


}

_SECTION_END();



Wednesday, August 27, 2008, 2:27:42 PM, you wrote:


> i attempted to enhance the barlabelling functions from the User KB. 

> when i added weekday, it does seem to print  the weekday of the 

> cursor  selected bar and not the weekday of the bar in context. how 

> do i fix it. it seems to work well in all other cases except weekday.




> _SECTION_BEGIN("BAR LABELING");  

> ShowBars = ParamToggle("Label Bars","NO|YES",0);

> LabelCo = ParamColor("Label",colorYellow);

> Label = ParamList("Bar 

> Label","NUMBER|TIMENUM|DATENUM|BARNUM|WEEKDAY",0); 

> GraphXSpace = 10; 

> if( Showbars ) 

> { 

> DN=DateNum(); 

> TN=TimeNum(); 

> FirstVisibleBar = Status( "FirstVisibleBar" ); 

> Lastvisiblebar = Status("LastVisibleBar");  

> for( b = Firstvisiblebar, BN=0; b <= Lastvisiblebar AND b < BarCount; 

> b++) 

> { 

> if( Label == "NUMBER" ) BarLabel = NumToStr(BN++,1.0); 

> else if ( Label == "TIMENUM" ) BarLabel = NumToStr(TN[b],1.0); 

> else if (Label == "BARNUM" ) BarLabel= NumToStr(b,1.0); 

> if (Label == "WEEKDAY" ) BarLabel= NumToStr(DayOfWeek(),1.0); 

> else BarLabel= NumToStr(DN[b],1.0); 


>         PlotText("\n^\n"+BarLabel,b,L[b]-(H[b]-L[b]),LabelCo); 

>         }


> } 

> _SECTION_END();



> ------------------------------------


> 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/



__._,_.___

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

__,_._,___