Metatrader 5 versions of indicators ... - page 29

 
player9:
Hmm. Thanks, however I'm not sure I understand.

I mean, I can make it to work (to get the price value) for only one or several independent averages. For example:

double  ma[];
int     mah;

   mah=iMA(NULL,PERIOD_M1,21,0,MODE_SMA,PRICE_CLOSE);

   ArraySetAsSeries(ma,true);  
   CopyBuffer(mah,0,0,1,ma);
   double xma=ma[0];
This works fine.....


 But how to convert this into mql5?

   for(tf=0; tf<NTF; tf++)
   {

      bar = iBarShift(NULL, tfp[tf], curTime, false);

      for(i=0; i<NMA; i++)  fma[tf][i] = iMA(NULL, tfp[tf], ma_period[i], 0, MA_mode, PRICE_CLOSE, bar/Period());
      for(i=0; i<NMA; i++) tmpArray[i] = fma[tf][i];                              

      ArraySort(tmpArray);                                                                                       

         lowestMA  = tmpArray[0];
         highestMA = tmpArray[6];

      for(i=0; i<NFL; i++)                                                                                     
      {
         fib_up[tf][i]   = lowestMA  + fib[i];
         fib_down[tf][i] = highestMA - fib[i];
      }
   }

I just can't get my head around it.

First of all, this line

     for(i=0; i<NMA; i++)  fma[tf][i] = iMA(NULL, tfp[tf], ma_period[i], 0, MA_mode, PRICE_CLOSE, bar/Period());

is a nonsense (the "bar/Period()" is ... whatever - that part will not do the intended job even in mt4 and will cause serious errors)

As of the rest : take a look at some of the indicators posted at this same thread and at this thread : https://www.mql5.com/en/forum/180596/page39 - a lot of multi time frame indicators that can be used as a pattern how to do mtf work

 

Extended version of ADXm (from here  https://www.mql5.com/en/forum/180596/page39)


Additions :

  • first of all : serious code optimization done
  • multi time framing added
  • alerts added
  • multiple coloring choices added
  • choice of "dynamic" levels added (floating and quantile levels) or no levels at all can be set in parameters
  • price pre-smoothing added (4 types of averages can be used for that)

As usual, 22 types of prices can be used too.


Files:
 
mladen:

Extended version of ADXm (from here  https://www.mql5.com/en/forum/180596/page39)


Additions :

  • first of all : serious code optimization done
  • multi time framing added
  • alerts added
  • multiple coloring choices added
  • choice of "dynamic" levels added (floating and quantile levels) or no levels at all can be set in parameters
  • price pre-smoothing added (4 types of averages can be used for that)

As usual, 22 types of prices can be used too.


Wonderful :)
 
mladen:

Extended version of ADXm (from here  https://www.mql5.com/en/forum/180596/page39)


Additions :

  • first of all : serious code optimization done
  • multi time framing added
  • alerts added
  • multiple coloring choices added
  • choice of "dynamic" levels added (floating and quantile levels) or no levels at all can be set in parameters
  • price pre-smoothing added (4 types of averages can be used for that)

As usual, 22 types of prices can be used too.


Very nice
 
Is it possible to fix this indicator? Since today's update it creates some 250MB indicator log files and finally crashes my mt5.
Files:
setka.mq5  13 kb
 
chriseel:
Is it possible to fix this indicator? Since today's update it creates some 250MB indicator log files and finally crashes my mt5.

Try it out now

Files:
setka.mq5  25 kb
 

The indy log cleared, but I still get this "Objects    loading of 1009007 objects took 6708 ms, reduce the number of objects please"

And the mt5 takes up to 3Gbs of ram, with 8 1min charts open

 
chriseel:

The indy log cleared, but I still get this "Objects    loading of 1009007 objects took 6708 ms, reduce the number of objects please"

And the mt5 takes up to 3Gbs of ram, with 8 1min charts open

You must set the max number of bars on chart to smaller value

Use 5000 (I use 5000 bars all the time and all is just fine like that) - or set the MaxBars parameter value to some value (if it is set to 0, then all the bars are processed)

 
Yes, that should do it. Changed my templates and back to 300Mb ram. Thank you
 
mrtools:

Added arrows, the alerts also will correspond with the zero cross, which btw is the same as when the ma's cross.

 

 

I thank you mrtools
Reason: