Errors, bugs, questions - page 2624

 
Михаил:

I don't often look for arrow codes, but they are incredibly hard to find in the help!

It's a table with asterisks, circles, etc.

And the search returns anything but the right one!

Wingdings
 

Forum on trading, automated trading systems and strategy testing

Libraries: HistoryTicks

fxsaber, 2020.01.09 14:43

Didn't notice that the KB version is old. Unfortunately there is no way to update. The KB machine gives this
MQL4\Include\fxsaber\HistoryTicks\ArrayResize.mqh(110,14) : error 165: 'ArrayResize_Real' - function already defined and has body
MQL4\Include\fxsaber\HistoryTicks\ArrayResize.mqh(172,14) : error 165: 'ArrayResize_Real' - function already defined and has body
MQL4\Include\fxsaber\HistoryTicks\ArrayResize.mqh(110,14) : error 165: 'ArrayResize_Real' - function already defined and has body
MQL4\Include\fxsaber\HistoryTicks\ArrayResize.mqh(172,14) : error 165: 'ArrayResize_Real' - function already defined and has body
Everything compiles in ME without errors.
 
Stanislav Korotky:

Why in line 3:

"sign mismatch" warning?

Datetime is supposed to be an unsigned number (8 bytes like ulong). Give me an example of a negative date.

probably because there is no separate timestamp type and datetime is also used to store the time difference
 
Can you tell me which event (if any) is generated in the tester when the Stop button is pressed?
 
Once again, help! I don't know how to get a better connection back, changing account doesn't help
Files:
Mc3FTItT2F8.jpg  18 kb
 

When applyingChartSetSymbolPeriod inOnInit indicator during debugging on current data there is a strange thing - in OnTick() rates_total from old TF, and arrays of timeseries from new one:

datetime shift,arr[],arr2[];
void OnInit()
  {
 if (ChartPeriod()!=PERIOD_D1)
 {
     ChartSetSymbolPeriod(0,Symbol(),PERIOD_D1);
     CopyTime(Symbol(),PERIOD_D1,0,iBars(Symbol(),PERIOD_D1),arr);     
     ChartRedraw();
     Sleep(100);
  }  
 CopyTime(Symbol(),PERIOD_H1,0,iBars(Symbol(),PERIOD_H1),arr2); 
  }

Here we see Time[x] from Daytime, andrates_total from H1, while in the debugger window the chart's TF has changed to Daytime.


 
Aleksey Mavrin:

When applyingChartSetSymbolPeriod inOnInit indicator during debugging on current data there is a strange thing - in OnTick() rates_total from old TF, and arrays of timeseries from new one:

Here we see Time[x] from Daytime, andrates_total from H1, with the chart's TF changed to Daytime in the debugger window.


When you change timeframe, the indicator is completely recreated. I.e., the previous indicator handle is deleted and the new one is created.
But there is one "but". The previous indicator is still present for some time.

Isn't it the reason...

 
Aleksey Mavrin:

When applyingChartSetSymbolPeriod inOnInit indicator during debugging on current data there is a strange thing - in OnTick() rates_total from old TF, and arrays of timeseries from new one:

Here we see Time[x] from Daytime, andrates_total from H1, with the chart's TF changed to Daytime in the debugger window.

IndicatorRelease

Документация по MQL5: Доступ к таймсериям и индикаторам / IndicatorRelease
Документация по MQL5: Доступ к таймсериям и индикаторам / IndicatorRelease
  • www.mql5.com
//|                                        Test_IndicatorRelease.mq5 | //|                        Copyright 2010, MetaQuotes Software Corp. | //|                                             https://www.mql5.com | //| Expert initialization function                                   |...
 
Artyom Trishkin:

When timeframe changes, the indicator gets completely recreated. It means the previous indicator handle is removed and the new one is created.
But there is a "but". The previous indicator is still present for some time.

Isn't it the reason...

Yes, as I understood from my experiments, afterChartSetSymbolPeriodOnInit is completed and once (in debug mode at least) OnCalculate is executed (at this moment it is caught). I.e. it doesn't interfere with online operation.

The fact that data of different timeframes may arrive in OnCalculate is just a bug, I think.

 
Is this a flaw in ArraySwap?
void OnStart()
{
  int ArrayStatic[1];
  int ArrayDynamic[];
  
  ArrayResize(ArrayDynamic, ArraySize(ArrayStatic));
  
  Print(ArraySwap(ArrayStatic, ArrayDynamic)); // false
}
Reason: