Re: [amibroker] Re: [HELP] Conditional formatting in Commentry Window

 

hello

allready you have many examples in your Folder Amibroker/formulas with  the words actionCommentary , WriteIf , WriteVal , printf and much more.
maybe you have to open that Afl files and read. Go there and see Tomasz technique

Please Re-read carefully   https://www.amibroker.com/guide/h_commentary.html

At the bottom of this page says   
For more examples on AFL commentaries please check AFL formula library especially MACD commentary formula which demonstrates all techniques presented here.

in my sample code was untested and  i should use the printf also.....try again
if( Status( "action" ) == actionCommentary )
{

    printf( "\n"
            + WriteIf( RSI() > 50, EncodeColor( colorGreen ) + "\n rsi is >50" ,
                       EncodeColor( colorRed ) + "<b>\n Oooo Mama </b>" + EncodeColor( colorBlue ) + "\tTime for maths" )

            + WriteIf( StochK() < 50, "<b><i> Hmm Yes</i>", EncodeColor( 30 ) + " what is goning on?" )

          );
}


Below is one of Tomasz example  that use actionCommentary ,WriteIf ,WriteVal ,printf

if( Status("action") == actionCommentary )
{
n1 = NVI();
n2 = MA(n1, 260 );

printf("\nCurrent value of NVI is " + WriteVal( NVI() ));

printf("\nThe interpretation of the NVI assumes that on days with decreased Volume, the 'smart money' is quietly taking positions. Thus, the NVI displays what the smart money is doing by showing price action only when Volume is decreasing. NVI is most usefuly as a bull market indicator." );
printf("\n\nCurrently NVI is "+WriteIf( n1 > n2, "above", "below" )+" its 260 period (one year on daily chart) moving average.");
printf("\n"+
WriteIf( n1 > n2, "It crossed above " +
WriteVal( BarsSince( Cross( n1, n2 ) ), 1.0 ) +
" bars ago. Norman Fosback in 'Stock Market Logic' states that the odds of a bull market are 95 out of 100 when the NVI rises above its one-Year moving average.",
"This alone does NOT give any useful hint about the future performance of this security."));
}

Panos


On 16-06-16 4:47 AM, meanomalist@yahoo.com [amibroker] wrote:

 

Dear Panos,

I am using this code and it's not outputting anything in Commentry Window, wondering does writeif() even support conditional Formatting?


if( Status("action") == actionCommentary  )
    {
WriteIf(RSI()>50, EncodeColor( colorGreen )+"\n rsi is >50" ,
        EncodeColor( colorRed )+"<b>\n Oooo Mama </b>"+EncodeColor( colorBlue )+"\tTime for maths");
 
WriteIf(StochK()<50, "<b><i> Hmm Yes</i>", EncodeColor( 30 )+" what is goning on?");
    }


__._,_.___

Posted by: Panos Boufardeas <panosbouf@gmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (6)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.

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


.

__,_._,___


EmoticonEmoticon