I crated Custom Indicator but Symbol name appears at the START.
I just want to hide the symbol name only and inner title are needed for the custom value with its respective colors.
Please find attached the screenshot.
I crated Custom Indicator but Symbol name appears at the START.
I just want to hide the symbol name only and inner title are needed for the custom value with its respective colors.
Please find attached the screenshot.
// use blanck between " "
Plot (Indicator,"",colorDefault,StyleLine);
what you are talking is for inside title for the individual custom indicator
(as I have several custom value in that row)
I am talking about SYMBOL NAME or Ticker ID
which is clearly indicated in my screenshot with arrow mark (second screenshot)
//Try
Title = VarGetText("Title") + "";
Read the manual
https://www.amibroker.com/guide/h_indbuilder2.html
Title Defines title text
// simple example
Title = "Any Title you want ";
More complex example:
// with name
Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) );
// or without name
Title = StrFormat("Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) );
// shorter one without name and without OHLCV
Title = "{{VALUES}}";
thanks for the help
I used the second code in your example as shown below
// or without name
Title = StrFormat("Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) );
and got the output which is attached here
my question is how to assign color for field indicated in the screenshot namely
Open
High
Low
Close
etc..
Use google search, you will get most of the answers straight away.
Scroll down to AFL Function Reference - ENCODECOLOR funcion usage
I am talking about how to give color to string which I highlighted in the screenshot namely
=> Open
=> Hi
=> Lo
=> Close
The example is right there in the code. did u try to run it?
EXAMPLE
Title = "This is written in " + EncodeColor( colorViolet ) +
"violet color " + EncodeColor( colorGreen ) +
"and this in green";
SEE ALSO Using colors in Indicator Builder
Don't hurry, read everything twice especially the KB article
It is up to you to arrange EncodeColor() in the order using it multiple times
Yes I run that code you have mentioned in the Encode Color and checked that too.
The following is my requirement, for that, code is given below
a=10;
b=16;
Title=StrFormat("Value A:%g,Value B:%g",a,b);
Here is the output of that code in image file
my requirement is, I need
BLUE color on the string = Value A
Red color on the string = Value B
what to do for it?
it is possible, you just have to look at the example properly.
_N(
Title =
EncodeColor(colorBlue) + "Value A" + EncodeColor(colorWhite ) + NumToStr( 10, 8.2 ) +
EncodeColor(colorRed ) +" Value B" + EncodeColor(colorWhite ) + NumToStr( 16, 4.0 )
);
Just do like this by using StrFormat
a=10;
b=16;
colA = EncodeColor(colorBlue);
colB = EncodeColor(colorRed);
colDef = EncodeColor(colorDefault);
Title=StrFormat("%sValue A%s:%g,%sValue B%s:%g",colA,colDef,a,colB,colDef,b);
thanks it works nicely
but how to bring in the a and b inside the code instead of directly using 10 and 16 in NumToStr function
thanks
it also works nicely
in your code, how to get two decimal point in the output like
Value A = 10.00
Value B = 16.00
Use other format specifier for numbers
Replace %g
specifier(s) by
%.2f
yes, I done it using the following code
(earlier I have asked about it)
a=10;
b=16;
_N(
Title =
EncodeColor(colorBlue) + "Value A" + EncodeColor(colorWhite ) + " = " + NumToStr( a, 3.2 ) +
EncodeColor(colorRed ) + " Value B" + EncodeColor(colorWhite ) + " = " + NumToStr( b, 3.2 )
);