Change Candle Size automatically when zooming in or out

Back to topics list To post a new topic, please log in or register
avatar
2
maccaroni 2016.03.11 16:21
 
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!
















Attached files:
  synergy_apbg2.mq4  (2.59 KB)
avatar
13006
WHRoeder 2016.03.13 02:24 #
 
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();

avatar
2
maccaroni 2016.03.13 13:16 #
 
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

avatar
13006
WHRoeder 2016.03.13 15:34 #
 

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.

Back to topics list  

To add comments, please log in or register