Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1408

 
Sergey Gridnev #:
It's just that the EA that creates objects should delete them when deinitialising.
What EA? I use standard (standard) drawing tools. And why delete objects? They should be stored in a bundle with a symbol and each time this symbol is loaded into the window, they should also be displayed. Each symbol has its own levels, trend lines, etc.
 
Yurka Tim #:
What EA? I use standard (standard) drawing tools. And why delete objects? They should be stored in a bundle with a symbol and each time you load this symbol into the window, they should also be displayed. Each symbol has its own levels, trend lines, etc.

The objects are stored in conjunction with the chart, not the symbol. And on the chart window can be any symbols. That's why each symbol has its own chart. And if you compare, you can change symbols in the chart.

 
Valeriy Yastremskiy #:

objects are stored in conjunction with a chart, not a symbol. And a chart can have any symbols on it. So each symbol has its own chart. And if you compare, you can change the symbols in the chart.

What's the point of binding drawing objects to a chart without linking them to a symbol? Well, it is as it is, what can be done. That's why I'm asking, maybe there are some tricks that cure it.
And so, MT and usability do not seem to know each other at all, programmers did for programmers :).
 

Friends, hello everyone )

Help, who knows. The Expert Advisor checks what orders are placed. And, periodically, when orders are executed or cancelled, i.e. OrdersTotal()=0, it still displays the property of the order, for example, type, symbol (probably the last in the history of orders). Is there a command, so that before rechecking the orders the Expert Advisor"clears the memory" so to speak, like ChartRedraw only for properties, data types? When the EA is restarted manually, there is no such problem for some time. Thanks in advance!

 
Vladimir Voronin property of the order, for example, type, symbol (probably the last in the history of orders). Is there a command that before rechecking the orders, the Expert Advisor"clears the memory" so to speak, like ChartRedraw only for properties, data types? When the EA is restarted manually, there is no such problem for some time. Thanks in advance!

I haven't encountered this problem, as I keep my own records of orders, but I can assume that these are properties of the last selected order (last paragraph https://www.mql5.com/ru/docs/trading/orderselect ).

 
Vladimir Voronin property of the order, for example, type, symbol (probably the last in the history of orders). Is there a command, so that before rechecking the orders the Expert Advisor"clears the memory" so to speak, like ChartRedraw only for properties, data types? When the EA is restarted manually, there is no such problem for some time. Thanks in advance!

Before any check, the order must be selected, even if it is one in the terminal. And in order not to doubt the correctness of the received properties, you should check the closing time. If the closing time is greater than zero, then the order is closed or removed.

And from this text it is not clear whether the question is about MQL5 or 4

 
//+------------------------------------------------------------------+
//|                                                  FXModel_exp.mq5 |
//|                                  Copyright 2022, MetaQuotes Ltd. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2022, MetaQuotes Ltd."
#property link      "https://www.mql5.com"
#property version   "1.00"
//--- input parameters
#include "fxlib.mqh"
#include "fxexplib.mqh"
//--- input parameters
input string   I_model_path="C:\FXModel\SampleNet.pt";
input int      I_input_size=100;
input string   I_symbol="EUR/USD";
input ENUM_TIMEFRAMES I_time_frame = PERIOD_M5;
input double I_lot_size = 0.1;
input double I_get = 18;
input double I_cut = 10;
input int I_cycle_sec = 300;
input int I_position_sec = 5;
//--- indicator buffers
//double Label1Buffer[];
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- create timer
   EventSetTimer(2);

//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//--- destroy timer
   EventKillTimer();

  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---

  }
//+------------------------------------------------------------------+
//| Timer function                                                   |
//+------------------------------------------------------------------+
void OnTimer()
  {
//---
   return;<===================
   MqlDateTime time;
   TimeTradeServer(time);
   if(IsTime(time, I_cycle_sec, I_position_sec) || FridayStopper(3, time))
      return;
   double ans[7];
   MqlTradeRequest request;
   MqlTradeResult result;
   MqlTradeCheckResult check;
//I_getPredict(ans);
   POSITTION type = GetPositionAns(ans);
   return;
   if(type == SELL)
      ;//Trade(I_symbol, I_get, I_cut, I_lot_size, ORDER_TYPE_SELL);//request = CreateRequest(I_symbol, I_lot_size, ORDER_TYPE_SELL);
   if(type==BUY)
      ;//Trade(I_symbol, I_get, I_cut, I_lot_size, ORDER_TYPE_BUY);//request = CreateRequest(I_symbol, I_lot_size, ORDER_TYPE_BUY);
   if(type== STAY)
      return;
//if(!OrderCheck(request, check) || !OrderSend(request,result))
//   return;
//MqlTradeRequest request2 = CreateSLTPRequest(result, I_symbol, request.magic, I_get, I_cut);
//if(!OrderSend(request2, result) || result.retcode != TRADE_RETCODE_DONE)
//   Comment("error");
   Sleep(I_position_sec*10+10);
  }
//+------------------------------------------------------------------+
//| Trade function                                                   |
//+------------------------------------------------------------------+
void OnTrade()
  {
//---

  }
//+------------------------------------------------------------------+

When tested to be traded

Compiled Many times

Compiled Many times

Changed the location return

Comment out traded method

Delete .mq5

The result does not change

 
1115 Libro #:

When tested to be traded

Why?

Compiled Many times

Changed the location return

Comment out traded method

Delete .mq5

The result does not change

This thread is out of sync with the original thread, so it is useless to post questions here.

https://www.mql5.com/ru/forum/6343/page1408

This is the original thread. Post here in Russian or in the English forum.

Вопросы от начинающих MQL5 MT5 MetaTrader 5
Вопросы от начинающих MQL5 MT5 MetaTrader 5
  • 2022.05.18
  • www.mql5.com
Подскажите пожалуйста, такой показатель тестера в жизни реален? И хороший это или плохой результат за год с депо 3000...
 
Nagisa Unada #:

This thread is not synchronised with the original thread, so it is useless to post questions here.

https://www.mql5.com/ru/forum/6343/page1408

This is the original thread. Post here in Russian or in the English forum.

ok thanks
 

Hello.

I'm new to the MT4 platform. I've entered the correct username and password, and the available balance even appears, but the NEW ORDER button is inactive, even though I have a balance to trade; the same thing happens on smartphones.


Could someone help me by telling me how to solve this?



Thank you in advance.