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

[amibroker] Re: can AFL really do *anything*?



PureBytes Links

Trading Reference Links

I took it as a challenge... :)

See if you can use this Yuki:



pds = 12; // I don't know your value for pds

// replace the RSIs with your formula 

Perf_T1 = SelectedValue(   RSI( 80 )   ); 
Perf_T2 = SelectedValue(   RSI( 43 )   ); 
Perf_T3 = SelectedValue(   RSI( 28 )   ); 
Perf_T4 = SelectedValue(   RSI( 50 )   ); 
Perf_T5 = SelectedValue(   RSI( 69 )   ); 
Perf_T6 = SelectedValue(   RSI( 34 )   );

// these are the strings corresponding to the values above, 
// NameT1 for Perf_T1 AND so on...

StaticVarSetText( "NameT" + 1, "\n\\c29Electrical Appliances " ); 
StaticVarSetText( "NameT" + 2, "\n\\c19Banks " );
StaticVarSetText( "NameT" + 3, "\n\\c16Real Estate " );
StaticVarSetText( "NameT" + 4, "\n\\c42Secureties " );
StaticVarSetText( "NameT" + 5, "\n\\c41Marine Trans " );
StaticVarSetText( "NameT" + 6, "\n\\c32" + FullName() + " " );

// sorting algorithm

for ( j = 2; j <= 6; j++ )
  {

  Value = VarGet( "Perf_T" + j  );
  String = StaticVarGetText( "NameT" + j );

  for ( k = j - 1; k > 0 AND VarGet( "Perf_T" + k ) > Value; k-- ) 

    {
    VarSet( "Perf_T" + ( 1 + k ), VarGet( "Perf_T" + k ) ); 
    text = StaticVarGetText( "NameT" + k ); 
    StaticVarSetText( "NameT" + ( 1 + k ), text );
    }

  VarSet( "Perf_T" + ( 1 + k ) , Value );
  StaticVarSetText( "NameT"+ ( 1 + k ), String );

  }

Title= "TSE Industry Performance Overview: Smooth-Factor: " + 
WriteVal( pds, 1 );

for ( n = 6; n > 0; n-- )
Title = Title + StaticVarGetText( "NameT" + n ) + 
NumToStr( VarGet( "Perf_T" + n ), 1.2 ) + " %";
  


Johan




 
> But can AFL do this: Can AFL order the industry group indices 
written
> on the left side of the chart via the title statement according to
> their values (as happens automatically in the right margin with the
> values themselves)?  That would be one heck of a neat thing if I
> could do that.
> 
> Yuki
> 
> Title statement section from chart: (chart attached, and as you can
> see, we've been having a bit of a party over here in the past 8 
weeks
> or so -- these are not even the best performers you see on the 
chart,
> others are in the 60 percentile range)
> 
> Title= "TSE Industry Performance Overview: Smooth-
Factor: "+WriteVal(pds,1.0)+"\n"
> +EncodeColor(colorBlue)+"Electrical Appliances "+EncodeColor
(colorBlack)+WriteVal(Perf_T1,1.2)+" %"+"\n"
> +EncodeColor(colorDarkGreen)+"Banks "+EncodeColor(colorBlack)
+WriteVal(Perf_T2,1.2)+" %  "+"\n"
> +EncodeColor(colorBlack)+"Real Estate "+WriteVal(Perf_T3,1.2)+" 
% "+"\n"
> +EncodeColor(colorYellow)+"Securities "+EncodeColor(colorBlack)
+WriteVal(Perf_T4,1.2)+" %"+"\n"
> +EncodeColor(colorGold)+"Marine Trans "+EncodeColor(colorBlack)
+WriteVal(Perf_T5,1.2)+" %"+"\n"
> +EncodeColor(colorRed)+FullName()+" "+EncodeColor(colorBlack)
+WriteVal(Perf_T6,1.2)+" %";





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

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

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