Download MetaTrader 5

CCHart and attach function

To add comments, please log in or register
wildbear
24
wildbear  

Hi, 

I'm a total newbie to mql5. And started playing with it.

Basically I want to modify the color of the price chart via the CCHart class.

 

It compiles with no errors or warnings. But it crashes as soon as I run the program

 

This is my code, it seems to crash on my attach function.

If I leave that out, no crash.

Thanks

 

 

int OnInit()

  {


   CChart ch;

   ch.Attach();

   ch.ColorBackground(clrBeige);

   return(0);

   

  }

Liping Wang
3719
Liping Wang  

No need to attach the chart before using it.

wildbear
24
wildbear  

i thought i needed that because my background color statement ( ch.ColorBackground(clrBeige); ) has no effect.

Must be missing something.

 

 

Liping Wang
3719
Liping Wang  
ColorChart
ColorChart
  • votes: 8
  • 2012.04.16
  • Karlis Balcers
  • www.mql5.com
Simple script to randomize all colors of your chart. Just click on it and see results yourself!
wildbear
24
wildbear  

Already had a look at it.

I did start off using setInteger as shown in the article. 

But I want to use the CChart Class instead, since there are other things I want to do but can't seem to  get it going...;(

wildbear
24
wildbear  

By the way, how do you execute a script from an ea, like the one you showed https://www.mql5.com/en/code/877.

 

I downloaded it, then what ? 


ColorChart
ColorChart
  • votes: 8
  • 2012.04.16
  • Karlis Balcers
  • www.mql5.com
Simple script to randomize all colors of your chart. Just click on it and see results yourself!
Liping Wang
3719
Liping Wang  

From MetaEditor compile it first, then click on the Red button to run the script.

wildbear
24
wildbear  
I mean, how do I attach it to an EA running already.
To add comments, please log in or register