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

RE: [amibroker] AddTextColumn question



PureBytes Links

Trading Reference Links

Terry,

 

AddTextColumn does work for me but on my uses of it I do not have as many parameters as you do.

 

Try this simple line first:

 

AddTextColumn(WriteIf(Buy, BUY"," “) “Buy” );

 

Dave


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Terry
Sent: Saturday, February 18, 2006 9:01 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] AddTextColumn question

 

AddTextColumn(WriteIf(Buy,"BUY","-"),"Buy?",1.2,colorWhite,colorGreen);

 

I thought using WriteIf() in the above was legal, but it doesn't work. Can anyone confirm or tell me if it's possible to get a text column with WORDS in it instead of just 1 or 0? I am using 4.77 beta. I also see Patrick has used the identical technique in "Efficient Stocks.afl" (Van K Tharp Efficient Stocks). This code does not work either in 4.77 for the AddTextColumn portions where there is a WriteIf().

 

 

Here's some test code to try in non beta version. Run an Explore.

"AddTextColumn Test";

 

SetChartOptions(1,chartShowDates);

 

/***************** CONSECUTIVE UP & DN DAYS *****************/

 

up = IIf(C > Ref(C,-1),1,0);

dn = IIf(C < Ref(C,-1),1,0);

runup = BarsSince(up == 0);

rundn = BarsSince(dn == 0);

 

 

ATRFast = ATR(20);

ATRSlow = ATR(100);

 

/********************** TRADE THE SYSTEM ************************/

 

Buy    = dn AND ATRFast > ATRSlow;

Sell   = up;

 

Buy = ExRem(Buy,Sell);

Sell = ExRem(Sell,Buy);

 

 

/********************** PLOTS ************************/

 

Plot(ATRFast,"ATRFast",colorRed);

Plot(ATRSlow,"ATRSlow",colorBlue);

 

 

/********************** EXPLORE ************************/

 

Filter = 1; //Buy OR Sell;

 

AddColumn(Buy,"BUY Value",1.0,colorGreen,colorWhite,75);

AddTextColumn(WriteIf(Buy,"BUY","-"),"Buy?",1.2,colorWhite,colorGreen);

AddColumn(Sell,"SELL Value",1.0,colorRed,colorWhite,75);

AddTextColumn(WriteIf(Sell,"SELL","-"),"Sell?",1.2,colorWhite,colorRed);

 

AddColumn(up,"Up",1.0,colorGreen,colorPaleGreen,75);

AddColumn(dn,"Dn",1.0,colorRed,colorPink,75);

 

AddColumn(ATRFast,"ATRFast",1.4,colorWhite,colorGreen);

AddColumn(ATRSlow,"ATRSlow",1.4,colorWhite,colorGreen);

AddTextColumn(WriteIf(ATRFast > ATRSlow,"ATR OK","ATR Failed"),"ATR Check");

 

--

Terry




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