Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1455

 

Rustam, use the date structure and the function to convert any date to this structure. Then refer to the fields of the structure and get the hours, minutes, centuries...

MqlDateTime date;
TimeToStruct(time,date);
printf(date.hour);
 

Please clarify:

From the documentation -"Testing trading strategies" phrase :

  • The ticks are not sent over the network, they are generated on the tester agents.

When using a local farm in"Every tick based on real ticks" mode - are ticks simulated on agents in the local network or is real history used?

Документация по MQL5 - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
Документация по MQL5 - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
  • www.mql5.com
Документация по MQL5 - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
Aleksey Vyazmikin:

You can save individual usable results to a file immediately by the advisor after the frame has been processed.

There can be more than 1 frame per pass, which will reduce the number of jobs.

For example I count 10000 results per pass and pass the same number of frames, which allows you not to go into genetics.

Could you please give me an example of code?

 
Alexander Generalov:

Could you please give me an example of the code?

Example of an EA working with frames in the appendix.

Files:
 

Hello. Can you please tell me why Start is equal to Start = 2021.04.22 00:00:00 ???

void DrawTimeZone(datetime Start, int Index)
{
   int _startIndex=Index-ShiftTime;
   datetime _start=Start+(TimeTradeServer()-TimeGMT());

There is no value assigned anywhere in the code, or am I mistaken and am I missing something somewhere?

 

Opening trades via CTrade

How do I know the result of my last trade?

Given that there is more than one robot, i.e. I can't just take the last trade from the history

 
Roman Sharanov:

Opening trades via CTrade

How do I know the result of my last trade?

Considering that more than one robot trades, just do not take the last trade from the history

You just need to catch the last trade in OnTradeTransaction()

Or you can look for perversions in the libraries...

 
Hi all, just an amateurish question... I'm a complete beginner. I am just starting my training with AM. I never used MT terminal. If i'm a beginner, i've never used it. If i've already used it, i may ask: Is it possible to save the levels on the chart when i exit the terminal?
 
partner67:
Hi all. Quite an amateurish question... I'm a complete novice. I'm starting to learn from AM. I have never used MT terminal before. If i'm a beginner, i've never used it before... Can i suggest if i may save the levels i have drawn on the chart when i exit the terminal (it's not convenient for studies).

All objects must be saved on exit.

 
partner67:
Hi all, just an amateurish question... I'm a complete novice. Just starting my AM training. I never used MT terminal. If i'm a beginner, i've never used it before. If i've already used it, i may ask: Is it possible to save the levels on the chart when i exit the terminal?

Check what UAC level is set.

Reason: