ArraySetAsSeries() function timeseries

 

I have got two Errors in this script. what is wrong?

'{' - unbalanced parentheses    trrrrr.mq4    in line 14  Error

')' - unexpected end of program    trrrrr.mq4    in line 47   Error

//+------------------------------------------------------------------+
//|                                                         test.mq4 |
//|                                                             test |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "test"
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
   datetime TimeAsSeries[];
//--- set access to the array like to a timeseries
   ArraySetAsSeries(TimeAsSeries,true);
   ResetLastError();
   int copied=CopyTime(NULL,0,0,10,TimeAsSeries);
   if(copied<=0)
     {
      Print("The copy operation of the open time values for last 10 bars has failed");
      return;
     }
   Print("TimeCurrent =",TimeCurrent());
   Print("ArraySize(Time) =",ArraySize(TimeAsSeries));
   int size=ArraySize(TimeAsSeries);
   for(int i=0;i<size;i++)
     {
      Print("TimeAsSeries["+i+"] =",TimeAsSeries[i]);
     }
 
   datetime ArrayNotSeries[];
   ArraySetAsSeries(ArrayNotSeries,false);
   ResetLastError();
   copied=CopyTime(NULL,0,0,10,ArrayNotSeries);
   if(copied<=0)
     {
      Print("The copy operation of the open time values for last 10 bars has failed");
      return;
     }   
   size=ArraySize(ArrayNotSeries);
   for(int i=size-1;i>=0;i--)
     {
      Print("ArrayNotSeries["+i+"] =",ArrayNotSeries[i]);
     }
 
Add:  }  at the end of your code. Regards.
 
Jose Francisco Casado Fernandez:
Add:  }  at the end of your code. Regards.

thanks,

but I get no data, only :

Custom indicator trrrrr EURUSD,H1: loaded successfully

Custom indicator trrrrr EURUSD,H1: removed

 
bah12ram:

thanks,

but I get no data, only :

Custom indicator trrrrr EURUSD,H1: loaded successfully

Custom indicator trrrrr EURUSD,H1: removed

It's a script, not an indicator. Save it like a script in MQL4\Scripts folder and try again. See Experts tab and no Journal tab. Regards.
 
Jose Francisco Casado Fernandez:
It's a script, not an indicator. Save it like a script in MQL4\Scripts folder and try again. See Experts tab and no Journal tab. Regards.

thanks a lot.

is it possible to copy OrderOpenTime() outputs in "TimeAsSeries" Array ?

 
bah12ram:

thanks a lot.

is it possible to copy OrderOpenTime() outputs in "TimeAsSeries" Array ?

Almost everything is possible, but the script is checking and storing candle times, and not orders. It would be necessary to create another script or EA for it. Regards.