Errors, bugs, questions - page 676

 

costy_,

try to re-initialise after a failed initialisation and get into an infinite loop?

I in Oninite initialise variables (assign values to variables) relating to the global level of the program. Being able to use non-zero return code allows me to print out the cause of failure and stop the program in a decent way (i.e. stop via OnDeinit). This is quite satisfactory.

 

Not perpetual, until successful completion of the initio. poiticovo (as an indicator) warning in the help.

Do you check the glob. variables after initialisation to see if they are initialised correctly?

Do you want to try to initialise them a few more times if the initialisation fails?

 

Thanks to those who responded. This code turned out to be a cut of the multicurrency EA - it was found that the tester doesn't want to eat it.

New details: the drop occurs only on March 7-8, 2011, only on Alpha forex

 

costy_

 Не вечный, до удачного завершения иниц. потиково (т.к. индикатор) предупредив в справке.

Apparently, I don't understand your intention, namely, I don't understand what "initialization in Oninit() po-tikovo" is, and what"successful initialization in Oninit() po-tikovo" is.

Do you check global variables after initialization to make sure they are initialized correctly?

Another concept which is new to me: "check global variables of a program after initialization for consistency with initialization".

But I can answer the question. Checking for success in assigning values to global variables of a program (for example, handles) occurs within the function Oninit(). In case of failure, I run the final loop there (in Oninit) if necessary. In the case of a final failure when assigning values to the variable within Oninit(), I send a message to the printer. Then I either find my error in the code or report it on the forum.

I do not check for the "initialization matching" type after termination of the Oninit() function, because it makes no sense when Oninit() function terminates successfully.

What about your example: a local variable bool err is declared there. Are you planning to initialize the local variable of the Oninit() function somehow?

Would you like to try to initialize them a few more times if they fail?

I do it all the time within Oninit() function, until it terminates.

Let me add. By "initialization" within this thread I mean assigning values to global variables within Oninit function (i.e., using slang). I'm adding it because client terminal starts its own process of global variables initialization before sending Init event.

 

ilunga

Indeed, better code and test conditions are in the servicedesk.

 

Intrali_vali_for_indicator() functionsynchronizing multipleMqlRates EURUSD[],AUDUSD[],GBPUSD[],NZDUSD[],USDCAD[],USDCHF[],USDJPY[];

there is no way to do it on the first try, in theory once synchronised and there are exemplary structures with xxxxxx[0].time == yyyyy[0].time== ..... zzzzzzzz[0] further sync by time > xxxxxxxx[0].time.

I created my init() function, but it's aboutOnInit()!

IfOnInit() fails then startup will not happen (if starter fails to start >> turn crankshaft by hand), then user needs either

  • list of indicators >> restart the ind.
  • remove ind. >> connect ind.
  • call for support >>
  • other

On ticko it is >> " on unsuccessful completion of f.OnInit()generates aDeinit event with cause codeREASON_INITFAILED"+ with subsequent reinitialization on the next tick until successful reinit. +

(Why do interrupt - deinit if the indicator will show hedgehogs anyway).

This is rather a question for developers...

 
abolk:
What about the problem with the inability to operate the "Reply" button on the forum? Are they going to fix it? Some sort of silence from support. At least a reassurance like "doing/not doing".
Fixed, thanks to everyone who paid attention.
 

costy_:

I can see what it's all about. I myself avoid the synchronisation problem, so I can't advise you on anything. But the problem itself has been discussed on the forum many times. Look it up with a keyword search.

 
Yedelkin:

I can see what it's all about. I myself avoid the synchronisation problem, so I can't advise you on anything. But the problem itself has been discussed on the forum many times. Look for the keyword search.

Thank you, I'll have another look.

 

Hello, could you please advise me?

I'm trying to add an ADX indicator for the trading module. I'm trying to make a signal of two moving averages with confirmation from ADX. I copied this code from another module, in the original version everything naturally works, I downloaded it from this site and the code itself should not give out errors.

//+------------------------------------------------------------------+
//| Create ADX indicator.                                            |
//| INPUT:  indicators -pointer of indicator collection.             |
//| OUTPUT: true-if successful, false otherwise.                     |
//| REMARK: no.                                                      |
//+------------------------------------------------------------------+
bool CSignalMY_MA_ADX::InitADX(CIndicators* indicators)
  {
//--- create ADX indicator
   if(m_ADX==NULL)
      if((m_ADX=new CiADX)==NULL)
        {
         printf(__FUNCTION__+": error creating object of the ADX");
         return(false);
        }
//--- add ADX indicator to collection
   if(!indicators.Add(m_ADX))
     {
      printf(__FUNCTION__+": error adding object of the ADX");
      delete m_ADX;
      return(false);
     }
//--- initialize ADX indicator
   if(!m_ADX.Create(m_symbol.Name(),m_period,m_period_ADX))
     {
      printf(__FUNCTION__+": error initializing object of the ADX");
      return(false);
     }
//--- ok
   return(true);
  }

But I must have done something wrong and got errors like these:

'==' - illegal operation use SignalADX-MA.mqh 183 12

'CiADX' - type mismatch SignalADX-MA.mqh 184 21

'=' - illegal operation use SignalADX-MA.mqh 184 16

'm_ADX' - parameter conversion not allowed SignalADX-MA.mqh 190 23

'm_ADX' - object pointer expected SignalADX-MA.mqh 193 14

Please help me, I will be very grateful. I can attach the file here if you need, don't mind it's a mess, I'm just learning and the whole process consisted of me cutting and pasting back a few different trading modules for the EA.


Reason: