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

[amibroker] Re: Can different string characters be stored in arrays?



PureBytes Links

Trading Reference Links

GP,

Thank you!!  Solves the problem and works like a charm....

Buzz


--- In amibroker@xxxxxxxxxxxxxxx, "gp_sydney" <gp.investment@xxx> 
wrote:
>
> Use "AddColumn" with the "formatChar" specifier:
> 
> AddColumn(IIf(Buy, 66, IIf(Sell, 83, 45)), "Sig", formatChar, 
etc...);
> 
> Those numbers are the ASCII character codes in decimal for the 
letters
> "B", "S", and "-" respectively. For a complete list, see here:
> 
> http://www.asciitable.com
> 
> Regards,
> GP
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Buzz M. Ross" <buzzmr@> wrote:
> >
> > If possible, I'd like to display different string characters in a 
> > column using AddTextColumn based upon some 'source' array values 
at 
> > particular bar index values.  In essence, the kind of algorithmic 
> > code I'd like to implement follows.  However, in attempting to do 
> > this, I get an AFL error 8 'type mismatch' verify message in the 
> > formula editor for the 'sig[i]' elements shown below.
> > 
> > Is there any way 'conditional' text strings can be displayed in 
> > columns for any version of AB using AFL?  I'm currently using 
version 
> > 4.74, which other than this particular problem, is good enough 
for 
> > most of my AB needs.
> > 
> > Here's the intended algoritm:
> > ----------------------------------------------------------
> > 
> > Buy = .....;  // generate 'Buy' array signals
> > Sell = .....; // generate 'Sell' array signals
> > Sell = Exrem(Sell,Buy);  /* get rid of successive sell signals 
till 
> >                                       next 'Buy' sig */
> > 
> > 
> > /*  Now, I want to create an array of text characters that 
correspond 
> > to the Buy and Sell signals that can be displayed in a text 
column */
> > 
> > for( i = 0; i < BarCount; i++ )
> > {
> > sig[i] = "-";  // no signal present
> > if( Buy[i] ) sig[i] = "B";   // Buy sig present
> > if{ Sell[i] )  sig[i] = "S";  // Sell sig present
> > }
> > 
> > Filter = 1;
> > 
> > AddTextColumn(sig,"Sig",2.3,colorYellow,IIf(Buy,colorDarkGreen,IIF
> > (Sell,colorRed,colorBlack)));  // colorize text cell appropriately
> > 
> > ---------------------------------------
> > 
> > 
> > I'd appreciate info on whether or not this is actually doable in 
AB, 
> > and if so, how to fix code above to work OR if this requires a 
more 
> > recent version of AB.
> > 
> > Thanks!!
> > 
> > Buzz
> >
>



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

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/