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 [email protected], "Buzz M. Ross" <[EMAIL PROTECTED]> 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
>


Reply via email to