Download MetaTrader 5

Change Candle Size automatically when zooming in or out

To add comments, please log in or register
maccaroni
8
maccaroni  
Hi

Is it possible to automatically change the Candle Size when i zoom out or zoom in?

When i zoom out for example, the candles are getting into each other, which looks like a mess (third Picture)

I am using Heiken Ashi Candles, mq4 File is attached. I think i need to write something like: If zoom 2x, then candle width 4..... 

But i dont know how to do that. Help, please :)

Thank You!
















Files:
whroeder1
16096
whroeder1  
maccaroni:I think i need to write something like: If zoom 2x, then candle width 4..... 

But i dont know how to do that.
int width=0;
int OnInit(){
   width = (int)   ChartGetInteger(0,CHART_SCALE);
   SetIndexBuffer(0,abHigh); ... SetIndexStyle(0, DRAW_HISTOGRAM, EMPTY, width);
   :
   return   INIT_SUCCEEDED;
}
int OnCalculate(...){
   if(ChartGetInteger(0,CHART_SCALE) != width)  OnInit();
maccaroni
8
maccaroni  
Thanks, but i still dont know how to implemet that into the indicator, i have virtually no coding knowledge.

Can you explain it? Or maybe its easier to copy the code into the mq4 file, this is the Width that i want to change at the beginning of the File:



#property indicator_width1 2
#property indicator_width2 2
#property indicator_width3 3
#property indicator_width4 3

whroeder1
16096
whroeder1  

If you use the width property it is fixed. Remove them.

If you use the function call (I showed) it can be varied. Add the code.

learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.

To add comments, please log in or register