Questions from Beginners MQL5 MT5 MetaTrader 5 - page 30

 
WiND:

Did a run on the tool on H1.

about 10% was done using the genetic algorithm.

Pressed stop and changed the parameters.

Now on startup - there is an "authorisation" in the agents.

If I change the instrument or period, everything starts to work.

I restarted the terminal, I restarted the agents - does not help.

I can't reboot.)

Please advise what for trouble?

How hard is it to reboot a computer? I don't know what the problem is, but a couple of days ago I had a similar bug. I ran optimization on my local agents overnight and in a while I switched off the internet. In the morning I found out that around the time I switched off the internet, optimization had stalled, and after restarting the agents had a record like "authorization required". Rebooted the computer - helped.
 
WiND:

Did a run on the tool on H1.

about 10% was done using the genetic algorithm.

Pressed stop and changed the parameters.

Now on startup - there is an "authorisation" in the agents.

If I change the instrument or period, everything starts to work.

I reset the terminal and restarted the agents - does not help.

I can't reboot.)

Please advise what for trouble?

I had this happen without any additional parameter changes, I just keep optimizing.

It seems that this innovation with continuation of optimizations doesn't go quite smoothly.

I couldn't do anything about it. At first I thought that my computer would think about it and continue optimizing... But no... this authorization hangs there.

I decided to do the following. I went back to my old method, "starting from scratch".

I wrote a short BAT which deletes folders cache,logs,agent.... It is possible to delete it manually.

 
Please tell me if this design can work at weekends, I mean, I haven't seen it working.
//+------------------------------------------------------------------+
//|                                                  PrintPERIOD.mq5 |
//|                        Copyright 2012, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   Print("Идентификатору PERIOD_W1 соответствует значение ",(int)PERIOD_W1); 
    Print("Идентификатору PERIOD_M1 соответствует значение ",(int)PERIOD_M1); 
     Print("Идентификатору PERIOD_M5 соответствует значение ",(int)PERIOD_M5); 
      Print("Идентификатору PERIOD_M15 соответствует значение ",(int)PERIOD_M15); 
       Print("Идентификатору PERIOD_M30 соответствует значение ",(int)PERIOD_M30); 
        Print("Идентификатору PERIOD_H1 соответствует значение ",(int)PERIOD_H1); 
         Print("Идентификатору PERIOD_H4 соответствует значение ",(int)PERIOD_H4); 
          Print("Идентификатору PERIOD_D1 соответствует значение ",(int)PERIOD_D1); 
           Print("Идентификатору PERIOD_MN1 соответствует значение ",(int)PERIOD_MN1); 
            Print("Идентификатору PERIOD_W1 соответствует значение ",(int)PERIOD_W1); 
             Print("Идентификатору PERIOD_W1 соответствует значение ",(int)PERIOD_W1); 
   
//---
   return(0);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
   
  }
//+------------------------------------------------------------------+
 
Dimka-novitsek:
Please tell me if this design can work on weekends and in general, i.e. I haven't seen it working.

Why in the form of an expert? There are no tics anyway.

Files:
 
Dimka-novitsek:
Please tell me if it can work at weekends, and in general, such a design, that is, I have not seen it work.

Someone kindly sent you the script yesterday: https://www.mql5.com/ru/forum/3775/page179#comment_305342

As for the current question: if unpacking goes into OnInit(), it should print at any program startup, including at weekends.

 

Thank you!!!

In expert form, no ticks, I was counting on it working at least once, it's OnInit.

 
Karlson:

I've had this happen without any additional parameter changes, but just a continuation of optimisation.

Apparently, this innovation with continuation of optimizations does not go quite smoothly.

I could not do anything about it. At first I thought that the computer would think about it and would continue... But no... this authorization hangs.

I decided to do the following. I went back to my old method, "starting from scratch".

I wrote a short BAT which deletes folders cache,logs,agent.... It is possible to delete it manually.

I'll give it a try. I'll give it a try.

Yedelkin, I can't reboot because the server will take too long to do it...

 
Dimka-novitsek:

Thank you!!!

In expert form, no ticks, I was counting on it working at least once, it's OnInit.

You have coded it correctly, it all works, even "on weekend" :) How do you run Expert Advisor, where do you check results?
 
Yedelkin:

Someone kindly sent you the script yesterday: https://www.mql5.com/ru/forum/3775/page179#comment_305342

And as for the current question: if unprinting goes into OnInit(), it should print at any program startup, including weekends.

Thanks!!! So, I've got some sort of, uh, flaws...

It worked! I'm sorry, I don't know what it was before.

But here.

2012.09.01 17:29:23 PrintPERIOD (EURUSD,M5) The value of PERIOD_W1 corresponds to 32769

2012.09.01 17:29:23 PrintPERIOD (EURUSD,M5) ID PERIOD_W1 corresponds to 32769

2012.09.01 17:29:23 PrintPERIOD (EURUSD,M5) ID PERIOD_MN1 corresponds to 49153

2012.09.01 17:29:23 PrintPERIOD (EURUSD,M5) PERIOD_D1 ID has the value 16408

2012.09.01 17:29:23 PrintPERIOD (EURUSD,M5) ID PERIOD_H4 corresponds to the value 16388

2012.09.01 17:29:23 PrintPERIOD (EURUSD,M5) ID PERIOD_H1 corresponds to the value 16385

2012.09.01 17:29:23 PrintPERIOD (EURUSD,M5) ID PERIOD_M30 has the value 30

2012.09.01 17:29:23 PrintPERIOD (EURUSD,M5) With the PERIOD_M15 ID there is 15

2012.09.01 17:29:23 PrintPERIOD (EURUSD,M5) The PERIOD_M1 identifier has the value 1

2012.09.01 17:29:23 PrintPERIOD (EURUSD,M5) The PERIOD_W1 identifier has the value 32769

Thank you!!! Interesting!!!

Yeah, it's actually the script offered to me that writes it, which I have inserted into the on tick function of my EA!

 

Has anyone used MoneyFixedRisk?
I use it like this:

cSymbol = new CSymbolInfo();
cSymbol.Name(Symbol());
cSymbol.Refresh();

cMoney = new CMoneyFixedRisk();
cMoney.Percent(2.0);
cMoney.Init(cSymbol, PERIOD_CURRENT, 1.0);

double sl = cSymbol.Ask()-Point()*50;
double lot = cMoney.CheckOpenLong(cSymbol.Ask(), sl);

Always returns 0.

If I set stoploss = 0, it returns minlot.

Demo account, there is 10000 dollars in the account) but why it returns zero I don't understand....

Reason: