Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 1159

 
STARIJ:

You can create copies of indicators with different names. File name = indicator name Automatically! You can use random numbers to form the name. But then how to find whose file is whose?


Random numbers are the same during initialisation and in order to change it through MathSrand you have to link it to something, isn't it ? The indicator name cannot be changed.

 
Vitaliy Sendyaev:

Random numbers are the same during initialisation and to change it via MathSrand you have to bind it to something again, no? You cannot change indicator name.


Each indicator has its own settings/parameters, that's how to name the file, i.e. "name+TF+symbol+parameter1+parameter2+parameter3"

 
Taras Slobodyanik:

Each indicator has its own settings/parameters, from them do the file name, i.e. "name+TF+symbol+parameter1+parameter2+parameter3".


If the input parameters are the same, the data in the indicator may be different in time, asit works with graphical objects. I use your method for less "capricious" indicators.

 
Vitaliy Sendyaev:

With the same input parameters, the data in the indicator may vary over time, asit works with graphical objects. I use your method for less "capricious" indicators.


then generate a name when the first object is created, write this name to the object (and/or a global variable) and on restart each takes its name in turn...

 

There is a dynamic, one-dimensional Variable array. I fill it with fractal data from D1 once a day. It's all running pretty slow. I'm trying to understand why. Any tips.

P.S. I am running MT5 Expert Advisor on MT4. I do not think it is slow because of that. I do not really think it is slow because of that. I do not think it is because of this code.

//+------------------------------------------------------------------+
int ii=1;
double  val;
double  Variable[];
static int    PrevTime=0;
int start=1;
int New_Day,N=0;
#include <InitMQL4.mqh>
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
void OnTick()
  {
//----
   int     BARS=iBars(NULL,1440);

   ArrayResize(Variable,ii+BARS,10);
   int Size=ArraySize(Variable);

   for(int x=0; x<N; x++)
     {
      //Print(" Variable[x] =",Variable[x]," x =",x," N =",N);
     }
//////////
   if(iTimeMQL4(NULL,1440,0)>PrevTime)
     {
      PrevTime=iTime(NULL,1440,0);
      New_Day=PrevTime;
      for(int i=BARS; i>0; i--)
        {
         val=iFractalsMQL4(NULL,1440,MODE_UPPER,i);
         if(val!=EMPTY_VALUE && val>0)
           {
            Variable[ii]=val;
            ii++;
           }
        }
      N=ii;
      ii=0;
     }
/////////
  }
//+------------------------------------------------------------------+
 
Dear traders, could you please suggest a speed or momentum indicator... which can be built into the strategy... so that one could place an order at maximum of minimum of a candle... I got it, but it's not stable. I think there's something like that... I need a 1-2 dollar pullback... minimal... that's all.
Files:
9na7.mq4  23 kb
 
ivan12347777:
Dear traders, could you please suggest a speed or momentum indicator... which can be built into the strategy... so that one could place an order at the maximum of the minimum of a candle... I got it, but it's unstable. I think there's something like that... I need a 1-2 dollar pullback... A minimum... that's all.
If I knew, I'd be living in Sochi. And the rest is in CodeBase - you have to look for it or go through similar ones by name
 
STARIJ:
If you knew the price, you would have lived in Sochi. And the rest is in CodeBase - you have to look for it or go through similar ones by name

Where is the enthusiasm and fire in the eyes?

 
ivan12347777:
Dear traders, could you please suggest a speed or momentum indicator... which can be built into the strategy... so that one could place an order at the maximum of the minimum of a candle... I got it, but it's unstable. I think there's something like that... I need a $1 or $2 pullback... minimum... that's all.
Speed = price change/time. Price = HI-low, time . Write to buffer. Speed = (High[1]-Low[1])/Period().
 

Guys, could you please tell me why the multi-currency indicator based on MA shows wrong results when I attach it to all JPY pairs? On other pairs it works fine.

Reason: