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

[amibroker] Setting up Yes/No Flags



PureBytes Links

Trading Reference Links

Hi folks,

I am starting to create various conditions to perform visual checks on
explorations.  For example I have a line of code that checks to see if
the closing price is a 21 day new closing high:

NH = C >= HHV( Close, 21);
this returns a 1.00 or a 0.00

I would like to take this example and a number of other conditions
that I would like to test for and create columns for them in the output.

But I really don't want to see a 1.00 or a 0.00.  What I would like to
see is a Yes or a No (even better would be a Yes or a null).

So I added the following line below the one above to convert the data
type from a number to a string:
NHF = WriteIf(NH, "Yes", " ");  // New High Flag

My problem is I can easily add the following:
AddColumn(NH, "NH");   which will add a column and display a 1.00 or a
0.00 (with formating I could get that to display a 1 or a 0).

What I would like to use though is the NHF variable. I have tried all
sorts of combinations with no luck.

This one AddColumn(WriteIf(NH, "Yes", "No"), "NHF"); gives me an error
that states: 
Error 5. Argument #1 has incorrect type (the function expects
different argument type here)

I am stumped.   Please help.

Thanks,

Dave
MarketMonk777
a.k.a. RedEyes






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