Errors, bugs, questions - page 270

 
Rosh:

Run such an indicator and you will see for yourself:

So in

int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])

open[] is not a time series either?

I don't understand anything, please give me an example of a time-series.

 
Voodoo_King:

build 375. the bug is really bad, as a result of which I have already lost quite some money...

The EA parameters are not restored to the settings after closing/opening the terminal.

To be more exact, some part of them can be restored (e.g. 3 out of 6), while the rest are reset to default settings.


build 381. NOTHING HAS CHANGED !!!

each time the terminal is restarted, the EAs are initialized with different parameters (whatever they want).

Incorrect initialisation of expert parameters

 
AlexSTAL:

This function checks the direction, not the change.

1) Without initialisation

2) With initialization

3) Above code, only with the ArrayGetAsSeries array indexing direction function

I made a mistake in the service-desk with the function name simply


Yes, I found out the compiler error. Thank you for the message. A fix will be in the next build.
 
BoraBo:

So in

open[] is not a time series either?

I don't understand, please give me an example of a timeseries.

So, it's not a TC, so what? Set it to a time series via Set and it will be a TC. Is this the first time you run the terminal? That for you it is such a big news. I think, someone just wrote that we should decide for ourselves how to work in their programs - with TS or just with arrays.
 
joo:


That's why I do this in OnCalculate():

Can you help me makeArrayGetAsSeries(low) give out true

 
BoraBo:

Can you help makeArrayGetAsSeries(low) output true?

I'm sick of it :)) set it how you want it and hello. There's nothing to check. :))
 
BoraBo:

So in

open[] is not a time series either?

I don't understand anything, please give me an example of time series.

open[] and all other arrays in OnCalculate are timeseries. In the very beginning, when MQL5 language was being written, ArrayGetAsSeries() returned true for them and their indexing was performed for them exactly as for timeseries, i.e. backwards.

But then it turned out to be very inconvenient and unnatural to write indicator buffer calculations in MQL4 style and there was only one way out - to reverse the indexing of timeseries for convenient use. We started to write custom indicators in this spirit:

int OnCalculate (const int rates_total,      // размер входных таймсерий
                 const int prev_calculated,  // обработано баров на предыдущем вызове
                 const datetime& time[],     // Time
                 const double& open[],       // Open
                 const double& high[],       // High
                 const double& low[],        // Low
                 const double& close[],      // Close
                 const long& tick_volume[],  // Tick Volume
                 const long& volume[],       // Real Volume
                 const int& spread[]         // Spread)
{
//---- переворачиваем все таймсерии, чтобы ими было удобно пользоваться, как обычными массивами
   ArraySetAsSeries(open,false);
   ArraySetAsSeries(high,false);
   ArraySetAsSeries(low,false);
   ArraySetAsSeries(close,false);
   ArraySetAsSeries(time,false);
   ArraySetAsSeries(tick_volume,false);
   ArraySetAsSeries(volume,false);
   ArraySetAsSeries(spread,false);
   ArraySetAsSeries(open,false);
.... остальной код
}

But every time we had to write such a mess of conversions turned out not to be a good idea either. Therefore it was decided to pass these timeseries with indexing, as for usual arrays. That's how we got such a paradox, when timeseries is not indexed like timeseries. That's why the help says that the indexing order should be checked and, if necessary, set as required.

 
BoraBo:

Help me makeArrayGetAsSeries(low) output true

It already returns true, but because of a compiler error its value is output incorrectly as a parameter. Check it this way:

#property script_show_inputs
input bool isTimeSeria=true;


double Ups[];
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {

//--- установим для массивов признак таймсерии
   Print("Установим для массивов признак таймсерии как ",isTimeSeria);
   ArraySetAsSeries(Ups,isTimeSeria);

//--- Проверим таймсерии
   if(ArrayGetAsSeries(Ups))
     {
      Print("1:  ArrayGetAsSeries(Ups)=true");
      Print("2:  ArrayGetAsSeries(Ups)=",ArrayGetAsSeries(Ups));
     }
   else
     {
      Print("ArrayGetAsSeries(Ups)=true!!!");
     }
  }
//+------------------------------------------------------------------+


Result:


 
Rosh:

It does give true, just because of a compiler error its value as a parameter is output incorrectly. Check it this way:


Result:


Thanks, figured it out.

ArrayIsSeries() andArrayGetAsSeries() in the conditional if() operator work as described, but Print() always outputs false.


 

Developers.

1. Please check the loading of the history into the tester (this is the first time I'm testing).

I am testing EURUSD using a standard MACD Sample on H1 with interval "last month".

I reached 57% of downloaded data and freezes successfully, with only this line in the log

2011.01.19 17:16:23	Tester	EURUSD: history preliminary downloading started

2. Is it possible to make the leverage of 1:200 and 1:500 in the new builds in the tester constantly?

I understand that not all brokerage companies have such leverage, especially on MT5, but in the Strategy Tester this should probably be left because it is more convenient to test strategies on a new platform.

Reason: