Any advice - I'm doing forward optimisation, but for some reason there are no 2 options by criterion in the optimisation results. as I understand, there should be back and forward data. there's nothing similar in the context menu either. how can I see back and forward data from the optimisation results?
When a Start event occurs in the script, it is handled by the OnStatr() function.
I have written a script called Print_1.
voidOnStart()
{
int x, y, z;
x=5;
y=4;
z=x+y;
printf(IntegerToString(z));
}
I think this function should print to terminal log number 9 when user clicks on Print_1 script. But nothing happens.
How and where in the terminal to see output z on the screen? What is the source of the Start event? How to start it so that number 9 finally appears on the screen? And run it from the terminal.
Сразу же после того, как клиентский терминал загрузит программу (эксперт или пользовательский индикатор) и запустит процесс инициализации глобальных переменных, будет послано событие Init, которое обрабатывается функцией OnInit(), если она есть. Это событие также генерируется после смены финансового инструмента и/или периода графика, после...
When a Start event occurs in the script, it is handled by the OnStatr() function.
I have written a script called Print_1.
I think this function should print to terminal log number 9 when user clicks on Print_1 script. But nothing happens.
How and where in the terminal to see the output z on the screen? What is the source of the Start event? How to start it so that number 9 finally appears on the screen? And I want to run it from the terminal.
Print and printf print the information to the "Toolbox" window, to the "Experts" tab.
Данные типа double выводятся с точностью до 16 десятичных цифр после точки, при этом данные могут выводиться либо в традиционном либо в научном формате – в зависимости от того, как запись будет наиболее компактна. Данные типа float выводятся с 5 десятичными цифрами после точки. Для вывода вещественных чисел с другой точностью либо в явно...
Sysmart: How can I track the moment when an order triggers in order to place another order in the same direction and at a certain distance? (on mql5)
//+------------------------------------------------------------------+//| TradeTransaction function |//+------------------------------------------------------------------+voidOnTradeTransaction(constMqlTradeTransaction &trans,
constMqlTradeRequest &request,
constMqlTradeResult &result)
{
//--- get transaction type as enumeration valueENUM_TRADE_TRANSACTION_TYPE type=trans.type;
//--- if transaction is result of addition of the transaction in historyif(type==TRADE_TRANSACTION_DEAL_ADD)
{
if(HistoryDealSelect(trans.deal))
m_deal.Ticket(trans.deal);
elsereturn;
if(m_deal.Symbol()==m_symbol.Name() && m_deal.Magic()==InpMagic)
{
if(m_deal.DealType()==DEAL_TYPE_BUY || m_deal.DealType()==DEAL_TYPE_SELL)
{
if(m_deal.Entry()==DEAL_ENTRY_IN)
Sysmart: New problem, you need to select the last open position in the hedge
OnTradeTransaction+ variable declared in EA header. The variable stores the type of the last position opened. It is of long type and initialized with value '-1'. In OnTradeTransaction, you catch the moment when a position was opened and write it into the variable.
Then you check this variable in your code - if it is equal to '-1', then go through the loop and compare the time when each position was opened. Find the 'youngest' position andwrite it into the variable. If the variable is not equal to '-1' - then you compare it with the position type.
В языке MQL5 предусмотрена обработка некоторых предопределенных событий. Функции для обработки этих событий должны быть определены в программе MQL5: имя функции, тип возвращаемого значения, состав параметров (если они есть) и их типы должны строго соответствовать описанию функции-обработчика события. Именно по типу возвращаемого значения и по...
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
A word of advice to a beginner.
When a Start event occurs in the script, it is handled by the OnStatr() function.
I have written a script called Print_1.
I think this function should print to terminal log number 9 when user clicks on Print_1 script. But nothing happens.
How and where in the terminal to see output z on the screen? What is the source of the Start event? How to start it so that number 9 finally appears on the screen? And run it from the terminal.
A word of advice to a beginner.
When a Start event occurs in the script, it is handled by the OnStatr() function.
I have written a script called Print_1.
I think this function should print to terminal log number 9 when user clicks on Print_1 script. But nothing happens.
How and where in the terminal to see the output z on the screen? What is the source of the Start event? How to start it so that number 9 finally appears on the screen? And I want to run it from the terminal.
Print and printf print the information to the "Toolbox" window, to the "Experts" tab.
Print
Prints a message into the journal
PrintFormat
Formats and prints the sets of characters and values into a log file according to a preset format
Displayed on the screen via
Comment
Outputs a message in the upper left corner of the price chart
How can I track the moment when an order triggers in order to place another order in the same direction and at a certain distance? (on mql5)
I've heard it's not a good idea to doOnTradeTransaction, as it doesn't always work
New problem, you need to select the last open position in the hedge
OnTradeTransaction+ variable declared in EA header. The variable stores the type of the last position opened. It is of long type and initialized with value '-1'. In OnTradeTransaction, you catch the moment when a position was opened and write it into the variable.
Then you check this variable in your code - if it is equal to '-1', then go through the loop and compare the time when each position was opened. Find the 'youngest' position andwrite it into the variable. If the variable is not equal to '-1' - then you compare it with the position type.