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

RE: [amibroker] Conditional Help plz ?



PureBytes Links

Trading Reference Links

Moop,

 

The mistake you are making is that Amibroker does not have arrays of strings so you can't create the array DirClr. I have some code where trade is marked as +1 for long and -1 for short and this works (see screen shot below):

 

AddColumn(trade, "Trade", 1.0, IIf(trade == 1, colorGreen, IIf(trade == -1, colorRed, colorGold)), colorDefault);

 

Try modifying this for your situation, something like this:

 

AddColumn(Buy OR Sell,"Trade", 1.0, IIf(Buy, colorGreen, IIf(Sell, colorRed, colorGold)), colorDefault);

 

PS: Don't forget that Sell is NOT EQUAL to Short. Sell means to exit your Long position while Short means to take a Short position which you exit with a Cover. Of course you can say Short = Sell; Cover = Buy; if that's what you want.

 

--

Terry

 

-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of moopfx
Sent: Tuesday, January 03, 2006 00:36
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Conditional Help plz ?

 

Hi,

 

I must be stupid or something so go easy on me.

 

Putting together this code below that I simply want to have one column

that contains the direction of the trade i.e. a green Buy OR a red

Sell, depending on the explore condition. I'd like this to be in an

AddColumn line.

 

The part of the setting of the Dir tells me an error about an array

but I'll be stuffed if I can work out what's going wrong. I'm sure

it's a matter of not properly understanding Amibroker and how

variables should be correctly used.

 

Anyway help and guidance would be very much appreciated.

Moop

 

====feeble code attempt========

Buy = BullUpDay AND HigherBars AND MA12_yest_less AND MA12_today_more

AND MA(C,12)>MA(C,72) AND VolCheck ;

Sell = BullDownDay AND LowerBars AND MA12_yest_more AND

MA12_today_less AND MA(C,12)<MA(C,72) AND VolCheck ;

 

if (Buy) Dir = "Long" AND DirClr = "Green";

if (Sell) Dir = "Short" AND DirClr = "Red";

===============================

 

 

 

 

 

 

 

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

 

 



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





SPONSORED LINKS
Investment management software Real estate investment software Investment property software
Software support Real estate investment analysis software Investment software


YAHOO! GROUPS LINKS