PureBytes Links
Trading Reference Links
|
Hi Ron,
Re "Plot( Null..." -
I just picked Null off the top of my head while I was typing - you could use anything really, since you don't want to actually plot it and are just using it to add text to the title. Replacing Null with one of the indicators you are already plotting should prevent a rescale, or you could add StyleOwnScale arg at the end.
But based on the sample output you provided, I think you could just do it like this - if you like it, just replace the indicators with your own. If formatting doesn't come through in the e-mail, you may need to just adjust the spaces in the indicator names...
ind1 = ind2 = ind3 = ind4 = ind5 = Close;
Plot( ind1, EncodeColor( colorBlack ) + "ChartName" + EncodeColor( colorRed ) + " Rd", colorRed );
Plot( ind2, " Wh", colorWhite );
Plot( ind3, " Bu", colorBlue );
Plot( ind4, " Gn", colorGreen );
Plot( ind5, " Yl", colorYellow );
Plot( Ref( ind1, -1 ), "\n rRd", colorRed, styleNoLine|styleNoLabel );
Plot( Ref( ind2, -1 ), " rWh", colorWhite, styleNoLine|styleNoLabel );
Plot( Ref( ind3, -1 ), " rBu", colorBlue, styleNoLine|styleNoLabel );
Plot( Ref( ind4, -1 ), " rGn", colorGreen, styleNoLine|styleNoLabel );
Plot( Ref( ind5, -1 ), " rYl", colorYellow, styleNoLine|styleNoLabel );
Steve
----- Original Message -----
From: mrdavis9
To: amibroker@xxxxxxxxxxxxxxx
Sent: Wednesday, June 07, 2006 1:09 PM
Subject: Re: [amibroker] Custom TiTle Help
Steve, thanks for your great suggestions. I am short on time, so I tried this Plot(Null, suggestion, and it caused the vertical height of the existing plot lines to shrink.
I then substituted a value of "0" in place of Null, and there was no change.
Plot( Null, " CHART NAME", colorDefault, styleNoLine|styleNoLabel|styleNoTitleValue );
==============================
Later, when I have more time, I will try your suggestion shown below.
Title = EncodeColor( colorRed ) + "Open " + YestOpen + " " + Open
+ EncodeColor( colorGreen ) + " Close " + YestClose + " " + Close
+ EncodeColor( colorBlack ) + " CHART NAME"
+ "\n" + EncodeColor( colorWhite ) + "Here is example of starting new line"
+ "\n" + NumToStr( Close, 1.1 ) "plus example of controlling decimal places";
A year or so ago, I was able to sucessfully use Encode Color to control colors.
The final result that I want to show at the top of the chart will look something like what I am showing below.
MyChosenChartName Rd=12 Wh=27 Bu=19 Gn=55 Yl=27
rRd=10 rWh=20 rBu=10 rGn=50 rYl=20
Rd refers to the red line, and rRd refers to the Ref(Rd,-1) line.
Thanks again for your excellent suggestions. Ron D
----- Original Message -----
From: Steve Dugas
To: amibroker@xxxxxxxxxxxxxxx
Sent: Monday, June 05, 2006 1:44 PM
Subject: Re: [amibroker] Custom TiTle Help
Hi Ron - I think maybe you have 3 options:
1. Simplest, doesn't require a title - Move chart name from right to left side by including it in the 1st Plot statement:
Plot( Ind1, "CHART NAME Ind Name", colorRed, styleLine );
2. Quick fix - You can use the Plot function to add text anywhere in the title, but AB will append a value to it:
Plot ( Ind1...
Plot ( Ind2...
Plot( Null, " CHART NAME", colorDefault, styleNoLine|styleNoLabel );
Come to think of it, it would be quite handy to have something like StyleNoTitleValue so AB won't append the value, then we could just write
Plot( Null, " CHART NAME", colorDefault, styleNoLine|styleNoLabel|styleNoTitleValue );
It is much easier than writing a huge title - maybe I will suggest it! 8 - )
3. Construct a Title containing the names and values from all Plot statements, along with whatever else you want to add. It is really just a matter of
1) combining text and numerical values in the order you want
2) using spaces and newlines to position them where you want, and
3) using EncodeColor() to color each part to match your plots.
I find it helpful to line up the parts of the title in my AFL. Here is an example using built-in price arrays:
YestOpen = ref( Open, -1 );
YestClose = ref( Close, -1 );
Plot( Open, "Open", colorRed );
Plot Close, "Close", colorGreen );
Title = EncodeColor( colorRed ) + "Open " + YestOpen + " " + Open
+ EncodeColor( colorGreen ) + " Close " + YestClose + " " + Close
+ EncodeColor( colorBlack ) + " CHART NAME"
+ "\n" + EncodeColor( colorWhite ) + "Here is example of starting new line"
+ "\n" + NumToStr( Close, 1.1 ) "plus example of controlling decimal places";
Well, I haven't tested it so I hope it works! 8 - ) Good luck!
Steve
----- Original Message -----
From: mrdavis9
To: amibroker@xxxxxxxxxxxxxxx
Sent: Monday, June 05, 2006 1:33 AM
Subject: [amibroker] Custom TiTle Help
I feel very comfortable using the actual AFL language that TJ has so masterfully constructed.
However, my training as a programmer consists of one semester of using Punch cards to program a heat flow equation in Fortran in about 1962.
I am aware that if I comment out the Title name, then I can view all of the current values at the top of the chart, but I can no longer see the name that I have chosen for the custom indicator.
I have saved many of the Title posts made by this Yahoo group, but I am unable to modify any of them to perform as I want.
I would really like to be able to see the current values of my six plot lines displayed at the top of the chart as well as all of the REF(values,-1) displayed to the immediate left side of the current values.
Additionally, at the extreme right side of the title line, I also want to see the name that I have chosen fot this Custom indicator.
I will sure appreciate it a member of this Amibroker user group could supply me with a completed code that will do what I have described above.
Reading the descriptions in the user manual has rarely helped.
Virtually all of my learning has come come from reading the posts of this user group, and then experimenting with a functioning code that was posted.
Later,Ron D
|