Editing formula colors

 

Hi

i was looking at some indicator formulas and was wondering if anyone can help me change some color to a custom color. for example

ObjectSet("H4 line", OBJPROP_COLOR, DimGray)

the above is pretty straight forward if i want line to be black u just change dimgray to black, but how about if i want a custom color such as #464646 how to u do this?

Thnx in advance

 
shaker22a:
Hi

i was looking at some indicator formulas and was wondering if anyone can help me change some color to a custom color. for example

ObjectSet("H4 line", OBJPROP_COLOR, DimGray)

the above is pretty straight forward if i want line to be black u just change dimgray to black, but how about if i want a custom color such as #464646 how to u do this?

Thnx in advance

use this:

int myColor = C'0x46,0x46,0x46';

 

Color codes

shaker22a:
Hi

i was looking at some indicator formulas and was wondering if anyone can help me change some color to a custom color. for example

ObjectSet("H4 line", OBJPROP_COLOR, DimGray)

the above is pretty straight forward if i want line to be black u just change dimgray to black, but how about if i want a custom color such as #464646 how to u do this?

Thnx in advance

Here is the sort of code for color you are talking about

extern color CURRDAYColor = C'80,0,46' ;

go into a standard indicator and click on a color to alter it to another shade and a pop up box appears with all the standard colors go down to the bottom of the box and click on customand a new box appears the numbers in the right side list of red, green, blueare the numbers you can use in the code the variations are endless - have fun

cja

 

thnx this is what i want...

i am not much of a programmer so not sure where to put the code

in the bottom example

ObjectSet("H4 line", OBJPROP_COLOR, DimGray);

do i change the following only, OBJPROP_COLOR, DimGray to

extern color CURRDAYColor = C'46,46,46' ;

thnx in advance

 
shaker22a:
thnx this is what i want...

i am not much of a programmer so not sure where to put the code

in the bottom example

ObjectSet("H4 line", OBJPROP_COLOR, DimGray);

do i change the following only, OBJPROP_COLOR, DimGray to

extern color CURRDAYColor = C'46,46,46' ;

thnx in advance

u can do this

ObjectSet("H4 line", OBJPROP_COLOR, C'0x46,0x46,0x46);

or before the ObjecSet line insert this line

int myColor = C'0x46,0x46,0x46;

and use it like this: ObjectSet("H4 line", OBJPROP_COLOR, myColor);

 

works a charm many thnx