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

RE: [amibroker] Addtextcolumn - text on different bars



PureBytes Links

Trading Reference Links

Thomas.

Interesting.

Quote:

Tomasz Janeczko

2005-08-10 06:35:35Please note that AddTextColumn takes single string as a parameter, so you can only display text that does NOT vary on bar-by-bar basis.

Now I see why this code:

*******
// exploration for bullish candles
// Apply to All;
// Range n last days: 3 --> ONLY outputs text in Addtextcolumn for the last day.
// OR do separate explores with from / to , using a different date for the "last day" to be sent to output text.

Cond1 = Ref(C,-1) < Ref(O,-1);
Cond2= O < Ref(C,-1);
Halfbear = Ref(C,-1) + ((Ref(O,-1) - Ref(C,-1))/2);
Cond3 = C > Halfbear;
Cond4 = Close > Ref(O,-1);
Cond5 = O > Halfbear AND O < Ref(O,-1);

BullEng = Cond1 AND Cond2 AND Cond4;
InvPiercing = Cond1 AND Cond5 AND Cond4;
Piercing = Cond1 AND Cond2 AND Cond3;
VolUP = Volume > 1.5 * Ref(Volume,-1);

Filter = (Bulleng OR InvPiercing OR Piercing)
AND VolUP AND Close < 5.00 AND Close > 0.4 AND Close * MA(Volume,15) > 100000;
Buy = Filter;

AddColumn(Ref(O,-1),"Yest open",1.3);
AddColumn(Ref(C,-1), "yest close",1.3);
AddColumn(Ref(O,-1) - Ref(C,-1), " difference",1.3);
AddColumn((Ref(O,-1) - Ref(C,-1))/2,"half diff",1.3);
AddColumn(Halfbear,"halfbear",1.3);

text = WriteIf(BullEng, "BullEngul", WriteIf(InvPiercing,"InvPiercing",WriteIf(Piercing, "Piercing", "" )));
AddTextColumn(text, "caption", 1.2,colorGreen);

**********

does not output text in the addtextcolumn EXCEPT FOR the last day.

Pity.

In your examples the only time the addcolumn and addtextcolumns match is on the last day of the range.

One workaround for me is to set the from / to ranges back one day at a time.

I don't have a looping-enabled brain : could this be done in loops to query the values of previous bars and then use a valuewhen type function, or is this is a silly question?

ChrisB


"Thomas Z." <tzg@xxxxxxxxxxxxxxxx> wrote:
Hello Steve,
 
i know how the function works. The problem is that the text output works not same as with numbers.
Try out the code below with all quotations. When the condition is true we get the number 1 and should also get the text True in the second column.
 
Filter = 1;
Cond = C>Ref(C,-1);
AddColumn(Cond,"Number output",1.0);
AddTextColumn(WriteIf(Cond,"True",""),"Text output",1.0);
 
 
 
I remember it was not possible but maybe now there is any trick.
 
- - - - - - - - - - - - - - - - - - - -
Best regards
 
Thomas
- - - - - - - - - - - - - - - - - - - -
 

From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Steve Dugas
Sent: Monday, January 30, 2006 12:46 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] Addtextcolumn - text on different bars
 
Hi T,
 
Not 100% sure I understand the question, but did you accidentally reverse your args? 1st arg should be what you want to write on each line, 2nd arg should be the column header.
 
Steve
----- Original Message -----
From: Thomas Z.
Sent: Sunday, January 29, 2006 11:21 AM
Subject: [amibroker] Addtextcolumn - text on different bars
 
Hello
 
Does anyone know if there is a solution now to see the actual text at every bar in automatic analysis.
 
As you know the code below displays the same text at every bar in the result list, equally whether the condition is true or not.
 
Filter = 1;
AddTextColumn("C>Ref(C,-1)",WriteIf(C>Ref(C,-1),"C>Ref(C,-1)","nothing"),1);
 
- - - - - - - - - - - - - - - - - - - -
Best regards
 
Thomas
- - - - - - - - - - - - - - - - - - - -


Brings words and photos together (easily) with
PhotoMail - it's free and works with Yahoo! Mail.

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