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

[amibroker] Re: Code modification Please



PureBytes Links

Trading Reference Links

Try something like the following (untested)

if (LastValue(BarsSinceCrossedGreen) < LastValue(BarsSinceCrossedRed)) {
  // Last cross ever was up
} else {
  // Last cross ever was down
}

Or possibly

if (SelectedValue(BarsSinceCrossedGreen) < SelectedValue(BarsSinceCrossedRed)) {
  // Last cross up to selection was up
} else {
  // Last cross up to selection was down
}

Mike

--- In amibroker@xxxxxxxxxxxxxxx, "Mohammed" <softnews2003@xxx> wrote:
>
> 
> Hi all,
> 
> For the following code I'm using two values to show the number of bars
> since MACD cross. One value for up and one for down. These values
> showing both in the chart page, I would like to show only the last
> values depending to cross if the cross up I need to show the values for
> up and if it for down cross I need to show the value for down only.
> Instead of showing both values.
> 
> One_Houre_Green_Cross = Cross(MACD(), Signal());
> One_Houre_Red_Cross = Cross(Signal(), MACD());
> BarSinceCrossgreen = BarsSince( One_Houre_Green_Cross);
> BarSinceCrossred = BarsSince( One_Houre_Red_Cross);
> BarSinceCrossUp = StrFormat(" %g ", BarSinceCrossgreen, SelectedValue(
> ROC( C, 1 ) ) );
> BarSinceCrossDown = StrFormat(" %g ", BarSinceCrossred, SelectedValue(
> ROC( C, 1 ) ) );
> 
> GfxSelectFont( "Arial", 12, 700 );
> GfxSetBkMode( 1 );
> GfxSetTextColor( colorGreen);
> pxHeight = Status( "pxchartheight" );
> t = pxHeight;
> x5 = 101;
> 
> GfxTextOut( BarSinceCrossUp, x5, t -50);
> GfxSetTextColor( colorRed);
> GfxTextOut( BarSinceCrossDown, x5, t -25);
> GfxSelectFont( "Arial", 9, 700 );
> GfxSetTextColor( colorBlack);
> 
> Bar = "Bar";
> x4 = 78;
> 
> GfxTextOut( Bar, x4, t -50) ;
> GfxTextOut( Bar, x4, t -25) ;
> 
> Any one can help please.
> Regards
>




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

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