Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1365

 

What do you think is the best calculation:

//+------------------------------------------------------------------+
//| Расчет цены                                                      |
//+------------------------------------------------------------------+
int CNewBar::PriceHL2(void)
  {
   double pr;
   int res=ArrayResize(this.m_pr_hl2,this.m_rt);
   for(int b=this.m_rt-this.m_pc; b>0; b--)
     {
      pr=MathAbs((iHigh(this.m_symbol,this.m_timeframe,b) + iLow(this.m_symbol,this.m_timeframe,b))/2);
      m_pr_hl2[this.m_rt-b]=pr;//<0 ? NULL : pr;
     }
   return(res);
  }

Or is it better to pull out through

int  CopyHigh( 
int  CopyLow( 
 
Can the iCustom indicator be displayed in the web version of the terminal?
 

How to declare a class to make d[].m[]; class public

class CSMA_Greed : public CObject
  {
   CMAOnArray        chsma;
   struct SDoubleArray { double       m[];};
   string            m_symbol;
   ENUM_TIMEFRAMES   m_timeframe;
   int               m_max_period;
   int               rt,prv;
   double            temp;
   string            Symbol(void)         { return this.m_symbol;    }
public:
   SDoubleArray      d[];
                     CSMA_Greed(const string symbol,const ENUM_TIMEFRAMES timeframe,const int max_period);
                    ~CSMA_Greed(void){};
   void              Init(int MaxMAperiod);
   void              Solve(const int aRatesTotal,const int aPrevCalc,const double  &aData[]);
  };

It turns out there is an array, but I can't get it out

cg.d[1199].m[3720]
 

Interesting

Created it in OnInit()

   CNewBar *nb = new CNewBar(Symbol(), n_period);
      if(nb==NULL)
         continue;
      if(!list_new_bar.Add(nb))
        {
         delete nb;
         continue;
        }


Please tell me if the declaration of the parameter in subsequent functions burdens the system

CNewBar* nb = list_new_bar.At(i);
      if(nb == NULL)
         continue;
 
Mikhail Toptunov #:

Interesting

Created it in OnInit()


Please tell me if declaring a parameter in subsequent functions burdens the system

No. In subsequent functions you don't create a new one, you just get a pointer to the object already created in OnInit() from the list.

 
Hello. How can I formulate a condition to open a trade in mql5? Condition: The price has not changed over the last N bars on a certain timeframe.
 
Greetings!
I haven't logged into MetaTrader 5 for over three months (I was on a business trip with no connection). Now I can't log in to my account at all.
How can I use the account again? Or at least withdraw funds from it?
 
knoughr #:

Somewhere on a piece of paper you have the broker's website, username and password for your personal account written down. This is the piece of paper on which you carefully wrote down all this information when you registered. You have one, don't you? Then it's easy - you can do whatever you need to do in your personal office: make deposits, withdrawals, open new accounts, change the password on old ones.

And if you don't - who isn't hiding, it's not my fault.
 

Can anyone suggest how to find the maximum or minimum value in an array if the array has empty values defined asEMPTY_VALUE.


So this function doesn't work.

//+------------------------------------------------------------------+
//| Получим High для заданного номера бара                           |
//+------------------------------------------------------------------+
double CNewBar::iHighMax(int ot,int bands)
  {
   double result=-1;
   result=m_ExtLowerBuffer[ArrayMaximum(m_ExtLowerBuffer,ot,bands)];
   return(result);
  }

If I change EMPTY_VALUE to NULL , it also not work.

Maybe there is an easier workaround for the system or I will try to make a chinese puzzle).

Thanks in advance, kind people.

 
Mikhail Toptunov #:

Can anyone suggest how to find the maximum or minimum value in an array if the array has empty values defined asEMPTY_VALUE.


So this function doesn't work.

If I change EMPTY_VALUE to NULL , it also not work.

Maybe there is an easier workaround for the system or I will try to make a chinese puzzle).

Thanks in advance, kind people.

As far as I could understand you need to find maximal value of indicator which will never be equal to zero.

I hate NULL and always apply 0.0 in numerical values which never fails.

Reason: