Download MetaTrader 5
To add comments, please log in or register
Register as a seller and start making profit!
wildbear
24
wildbear 2012.09.29 01:18 

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
3657
Liping Wang 2012.09.29 06:21  

No need to attach the chart before using it.

wildbear
24
wildbear 2012.09.29 17:31  

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

Must be missing something.

 

 

Liping Wang
3657
Liping Wang 2012.09.29 18:08  
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 2012.09.29 18:12  

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 2012.09.29 18:36  

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
3657
Liping Wang 2012.09.29 18:43  

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

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