Errors, bugs, questions - page 841

 
faton:

Good afternoon. Can you advise me, I wrote a simple indicator... and when a new bar comes, this is how the indicator line behaves. What may be the problem?

CopyRates(FirstAktiv,PERIOD_CURRENT,0,rates_total,mrate1);
CopyRates(SecondAktiv,PERIOD_CURRENT,0,rates_total,mrate2);
Check what is returned byCopyRates. The number of copied elements is not necessarily equal to the requested. Therefore, the array can be overrun and data in this place of the buffer will be null, which happened.
 

It seems that while updating new version of Terminal, Program Files\Meta Trader 5\MQL5 folder is completely copied to C:\Users\user\AppData\Roaming\MetaQuotes\Terminal\00C5B588590D4A2C89EFC1E0C5301ECA\MQL5 (it is Win7, although other OS probably have same folder + maybe other ones too). Otherwise I can not explain, where is the pair of hours of work, done a few days ago and which fruit successfully tested.

The thing is, I have a habit of formatting classes through .mqh-file, and then linking them. Unknowingly, I threw my mqh and mq5 into Program Files\Meta Trader 5\MQL5, saw that they didn't appear in Navigator and moved them to work folder (C:\Users\user\AppData\Roaming\MetaQuotes\Terminal\00C5B588590D4A2C89EFC1E0C5301ECA\MQL5). Everything was fine, until the terminal was updated - I ran the Expert Advisor for testing further, and then I wanted to tweak something else and saw an old code, a copy of the one in Program Files\Meta Trader 5\MQL5. The correct version has been optimized, because mq5 has not changed and the terminal has not guessed that changes have been made in mqh. Recompilation has led to a return to the old version.

As a result I'm very annoyed and will have to spend one or two hours for what I've already done.

The ways out of this situation I see are.

1) copy the entire folder, but only the list of files included in the standard package;

2) somehow warn the user that it will be overwritten (although, if you change a lot of files in the standard library, it will be a pain);

3) determine somehow (calculate the crc, for example) that the mql5 folder in Program Files has changed, and before installing a new version, issue a warning so that you can save your data;

4) make a copy of the old MQL5 in Terminal\00C5B588590D4A2C89EFC1E0C5301ECA\ (add, for example, MQL5.384 version) - the easiest.

The problem is rare, but damn, it's a bad one.

Документация по MQL5: Стандартная библиотека
Документация по MQL5: Стандартная библиотека
  • www.mql5.com
Стандартная библиотека - Документация по MQL5
 
notused:

It seems that during the update of the new version of the terminal, there is a FULL copy of the folder.................................

........................... ......................

.............................

Bottom line - very pissed off, again having to spend an hour or two on something I've already done.

I can see a way out of this situation - ................

....................

It's a rare problem, but damn, it's a bad one.

Constructive feedback to developers: Please make an automatic backup of the entire MQL5 folder from the previous build, when installing a new one. The lifetime - until the next build, then replace it. This does not cancel the careful treatment of the client files when installing the build. It is for the case of force majeure (such as described above) + to save the client versions of the standard library.
Документация по MQL5: Стандартная библиотека
Документация по MQL5: Стандартная библиотека
  • www.mql5.com
Стандартная библиотека - Документация по MQL5
 

Recovery Factor- this indicator shows the riskiness of the strategy, how much the Expert Advisor is risking to earn the profit. It is calculated as the ratio of the profit gained to the maximal drawdown; (it doesn't say which one)

STAT_RECOVERY_FACTOR

Factor of recovery - ratioSTAT_PROFIT/STAT_BALANCE_DD

double



Print("Factor=",TesterStatistics(STAT_RECOVERY_FACTOR));                                    // Выводим Фактор Восстановления
Print("Profit/BalanceDD=",TesterStatistics(STAT_PROFIT)/TesterStatistics(STAT_BALANCE_DD)); // Отношение профита к просадке по балансу
Print("Profit/EquityDD=",TesterStatistics(STAT_PROFIT)/TesterStatistics(STAT_EQUITY_DD));   // Отношение профита к просадке по средствам

We have established experimentally that the recovery factor is calculated as the ratio of profit to drawdown by equity, not by balance.

Is there a mistake in the reference?

 
ilunga:
Well right, that's right, you've been shown the last 50,000. There are 1440 bars in the day.

Thank you, uh...

That's not the question. It's not a question, it's a sigh of sorrow...

If I only choose the month of June for the test (30 days X 1440 < 50,000), what am I supposed to see on the chart by reason? August???

By the way, the timpickers in the tester have the unpleasant property of closing themselves after a second - the other one...

It's not fatal - you can pick a date faster with your hands anyway, but...

 
//+------------------------------------------------------------------+
//|                                                  Sample_Tick.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"

int Tick_All;

MqlTick           last_tick;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   Tick_All=0;

//---
   return(0);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---

  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   if(!SymbolInfoTick(_Symbol,last_tick))
     {
      Print("Failed to get Symbol info!");
     }

   Tick_All++;
   Print(Tick_All,"   ",last_tick.bid,"   ",last_tick.ask,"  ",last_tick.last," ",last_tick.volume);
  }
//+------------------------------------------------------------------+

I do not understand why OnTick is triggered although price does not change?????

2012.09.10 11:52:11 Sample_Tick (EURUSD,M5) 493 1.2787 1.2789 1.2788 300000
2012.09.10 11:52:10 Sample_Tick (EURUSD,M5) 492 1.2787 1.2789 1.2788 300000
2012.09.10 11:52:09 Sample_Tick (EURUSD,M5) 491 1.2787 1.2789 1.2788 300000
2012.09.10 11:52:07 Sample_Tick (EURUSD,M5) 490 1.2787 1.2789 1.2788 300000

 
EQU:

Thank you, uh...

That's not the question. It's not a question, it's a sigh of sorrow...

If I only choose the month of June for the test (30 days X 1440 < 50,000), what should I see on the chart by reason? August???

Write to service-desk. I also don't understand why the number of bars on the chart _always_ counts from the real and not from the end date set in the tester.
 
sion:
Volume - can change, and there's more)

you can see that the volume doesn't change!!!

 
dentraf:

you can see that the volume doesn't change!!!

Looked at the code already.
 

I don't understand how it works or doesn't work)


Print("<><><><><",request_action.magic);//Print((ulong)MathMod(request_action.magic-MathMod(request_action.magic,100000000),100000000000)/100000000);
  if(magic_num!=(ulong)MathMod(request_action.magic-MathMod(request_action.magic,100000000),100000000000)/100000000){Print("<<<<<<<<<<<<<<<<<<<<<",(ulong)MathMod(request_action.magic-MathMod(request_action.magic,100000000),100000000000)/100000000," magic_num=",magic_num);return;}

KG 0 prp4 (EURJPY,M15) 02:23:25 <><><><><73200011000
RR 0 prp4 (EURJPY,M15) 02:23:25 <<<<<<<<<<<<<<<<<<<<<732 magic_num=732   <-поидее числа равны и условие не должно срабатывать

Commented Print

Print("<><><><><",request_action.magic);Print((ulong)MathMod(request_action.magic-MathMod(request_action.magic,100000000),100000000000)/100000000);
  if(magic_num!=(ulong)MathMod(request_action.magic-MathMod(request_action.magic,100000000),100000000000)/100000000){Print("<<<<<<<<<<<<<<<<<<<<<",(ulong)MathMod(request_action.magic-MathMod(request_action.magic,100000000),100000000000)/100000000," magic_num=",magic_num);return;}

MH 0 prp4 (EURJPY,M15) 02:28:11 <><><><><><73200011000
PE 0 prp4 (EURJPY,M15) 02:28:11 92233720368 <- and this number I don't know where it came from, apparently in the first calculation "(ulong)MathMod(request_action.magic-MathMod(request_action.magic,100000000),100000000000)/100000000" of this, something weird counts

<-condition didn't hold, the print didn't print, so the numbers were equal.

Until about 1am, there was no problem with this at all.

P.S. I tried it on my laptop, 687 build is still there, same pie.

Reason: