Questions from a "dummy" - page 21

 
AUser:

Can you tell me how much data can be crammed into one array? Array of MqlRates structure, I'm going to put all the history of hourly bars since 2009, will it fit?

PS. Also something with the strategy tester, it does not work on weekends because the server is unavailable or I have something glitched? It seems to be working properly on Friday))


1. You may think that the data should fit.

2. Probably a glitch, check it on the Expert Advisors that come with the terminal.

Also, do not take too deep history, there may be problems.

 
voix_kas:

1. The whole thing seems to be. If there is a limit, it is at the int or long threshold level. There is not so much RAM in the computer. =)

2. describe the problem with the tester not working more precisely. Error codes, screenshots...

Yes, like yesterday I ran my Expert Advisor in the tester and got results, I tried it today and got 0. I didn't change the code. I have tried to add some new codes but I erased them all, I have to check them again. I will double-check it tomorrow.
 

What are handles ? (can't find a common concept)

For example: for the Moving Average indicator handle

 
Zeleniy:

What are handles ? (can't find a common concept)

For example: for Moving Average indicator handle

Generally speaking about OOP - It's a unique identifier of object instance in OS (or as in our case in MT).

If we're talking about indicators, a handle can be considered as an identifier of an instance of an indicator with certain parameters.

 
Interesting:

In general terms regarding OOP - It is a unique identifier of the object instance in OS (or as in our case in MT).

If we talk about indicators, a handle can be seen as an identifier of an instance of an indication with certain parameters.

Thank you very much.
 
AUser:
I've tried it in the Strategy Tester yesterday and got results. I have not changed the code. I have tried to add some new codes but I erased them all, I have to check them again. I will double-check it tomorrow.

Yep, my bad, forgot to delete the stops)) Just noticed that in the tester, the comments don't pop up? Wrote here, stupidly copied koi from the help, to make it easier to understand. However, comments do not appear.

void OnTick()
{
 double Ask,Bid;
   int Spread;
   Ask=SymbolInfoDouble(Symbol(),SYMBOL_ASK);
   Bid=SymbolInfoDouble(Symbol(),SYMBOL_BID);
   Spread=SymbolInfoInteger(Symbol(),SYMBOL_SPREAD);
//--- Выведем значения в три строчки
   Comment(StringFormat("Выводим цены\nAsk = %G\nBid = %G\nSpread = %d",Ask,Bid,Spread));
if (Bid < 2 && !PositionSelect(_Symbol))
{OpenSell();}
}
void OpenSell()
{
MqlTradeRequest o; MqlTradeResult p;                                 
double Bid = SymbolInfoDouble(_Symbol,SYMBOL_BID);   
o.action = TRADE_ACTION_DEAL; 
o.symbol = _Symbol; 
o.volume = 0.25;  
o.price = Bid;
o.sl = 0;
o.tp = Bid - 0.00100;
o.deviation = 10;
o.type = ORDER_TYPE_SELL;
o.type_filling = ORDER_FILLING_AON;
OrderSend(o,p);
}
 
AUser:

Yep, my bad, forgot to delete the stops)) Just noticed that in the tester, the comments don't pop up? Wrote here, stupidly copied koi from the help, to make it easier to understand. However, the comments are not visible.

In my tester, the comments are displayed on the chart. See if your comment is not overwritten by the subsequent command Comment("");.
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы графиков / Свойства графиков
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы графиков / Свойства графиков
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы графиков / Свойства графиков - Документация по MQL5
 
voix_kas:
In my tester, it puts comments on the chart. See if your comment is overwritten by the subsequent command Comment("");.
My tester displays my technical comment (euro/dollar, hour1, four prices, name of expert). Apparently it wipes my comment))) I added it to the working chart - everything is as it should be.
 
How do I write copy from date to date? No matter how I write it, it doesn't copy.
CB = CopyRates(_Symbol,_Period,TimeCurrent(),D'04.01.2010',R);
0 to 5000 - it copies, but the date is probably not written correctly.
 
AUser:
How do I write copy from date to date? Whenever I write it, it doesn't copy. 0 to 5000 - it copies, but the date is apparently written incorrectly.

The current time is the second date (this should be clear from the help)...

int  CopyRates(
   string           symbol_name,      // имя символа
   ENUM_TIMEFRAMES  timeframe,         // период
   datetime         start_time,       // с какой даты
   datetime         stop_time,        // по какую дату
   MqlRates         rates_array[]     // массив, куда будут скопированы данные
   );
 

It is likely to work like this

CB = CopyRates(_Symbol,_Period,D'04.01.2010',TimeCurrent(),R);
Документация по MQL5: Дата и время / TimeCurrent
Документация по MQL5: Дата и время / TimeCurrent
  • www.mql5.com
Дата и время / TimeCurrent - Документация по MQL5
Reason: