Questions from Beginners MQL5 MT5 MetaTrader 5 - page 417

 
Greetings esteemed community!
Please advise, is it possible to save an array of class objects to a file? Or do they need to be converted to an array of structures to save them to a file?
 
BlackTomcat:
Greetings esteemed community!
Please advise, is it possible to save an array of class objects to a file? Or to save them to a file, should they be converted to an array of structures?
It is possible.
 
Dmitriy Skub:
Maybe.
Thank you, I'll give it a try. If it doesn't work, I'll come back with another question. :) If I understand correctly, then all information about the class methods is cut off?
 
Alexey Volchanskiy:
There is no Fibonacci indicator beginning with "i", it is hidden in the graphical objects. E_Ghazaryan, look through the Help file via this path. There is an example in MQL4 Reference / Standard constants, enumerations and structures / Object constants / Object types / OBJ_FIBO
Thank you, I will try to use it.
 
BlackTomcat:
If I understand correctly, all information about the class methods is stripped out?
Yes, only the data is retained during serialisation.
 

The help is silent, on the website they say it's expiry date in bars. I've tried everything from 1 to 100, the pending does not expire on its own.

I have never worked with pending orders. (I have never worked with pending orders before in my EA)

 
Leanid Aladzyeu:

The help is silent, on the website they say it's expiry date in bars. I've searched from 1 to 100 and the pending does not expire on its own.

I have never worked with pending orders. (I have never worked with pending orders before in my EA)

Maybe it's a date/time stamp.
 
Leanid Aladzyeu:

The help is silent, on the website they say it's expiry date in bars. I've searched from 1 to 100 and the pending does not expire on its own.

I have never worked with pending orders. (I have never worked with pending orders before in my EA)

Why read such nonsense? Just try to manually place a pending order and set an expiry time for it.


You will see right away that you don't set the time in relation to something, in bars, minutes or seconds; you set a specific time for removing the pending order. The only remark is that the time of expiration cannot be closer than ten minutes from the order opening time. The time loss at order opening must be taken into consideration.

 
Alexey Viktorov:

Why read such nonsense? Just try manually placing a pending order and setting an expiry time.

...

You should not be so reckless. The matter is that when an EA is generated using MQL5 Wizard, there is an expiry parameter and it is actually measured in bars:

//+------------------------------------------------------------------+
//|                                                         тест.mq5 |
//|                        Copyright 2015, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2015, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Include                                                          |
//+------------------------------------------------------------------+
#include <Expert\Expert.mqh>
//--- available signals
#include <Expert\Signal\SignalAC.mqh>
//--- available trailing
#include <Expert\Trailing\TrailingNone.mqh>
//--- available money management
#include <Expert\Money\MoneyFixedLot.mqh>
//+------------------------------------------------------------------+
//| Inputs                                                           |
//+------------------------------------------------------------------+
//--- inputs for expert
input string Expert_Title         ="тест"; // Document name
ulong        Expert_MagicNumber   =31146;  // 
bool         Expert_EveryTick     =false;  // 
//--- inputs for main signal
input int    Signal_ThresholdOpen =10;     // Signal threshold value to open [0...100]
input int    Signal_ThresholdClose=10;     // Signal threshold value to close [0...100]
input double Signal_PriceLevel    =0.0;    // Price level to execute a deal
input double Signal_StopLevel     =50.0;   // Stop Loss level (in points)
input double Signal_TakeLevel     =50.0;   // Take Profit level (in points)
input int    Signal_Expiration    =4;      // Expiration of pending orders (in bars)
input double Signal_AC_Weight     =1.0;    // Accelerator Oscillator Weight [0...1.0]
//--- inputs for money
input double Money_FixLot_Percent =10.0;   // Percent
input double Money_FixLot_Lots    =0.1;    // Fixed volume
//+------------------------------------------------------------------+
//| Global expert object                                             |
//+------------------------------------------------------------------+


The physical meaning of the signal expiration in bars: if the signal (pending order) does not trigger within a specified number of bars, this order will be deleted.

 
Karputov Vladimir:

You shouldn't be so reckless. The thing is that when generating an EA using MQL5 Wizard, there is an expiration parameter, and it is actually measured in bars:


The physical meaning of expiration in bars: if the signal (pending order) does not trigger within a given number of bars, this order will be deleted.

The number of bars should be converted into a time and passed to the open function.
Reason: