Questions from Beginners MQL5 MT5 MetaTrader 5 - page 998

 
Vladimir Karputov:

Service - Settings - Trading - "Show trades on the chart in real time".

Basically a great feature, only without the choice of timeframe to show, it's creepy on weeks.

 
BillionerClub:

Basically a great feature, only without the choice of timeframe to display, it's creepy in weeks.

What does timeframe have to do with it? The deal is shown (or not shown) on the timeframe. And the trade is displayed (or not displayed) by the SYMM.

 
Vladimir Karputov:

What does the Timeframe have to do with it? The trade is being executed according to the Symbol. And the trade is displayed (or not displayed) by the Symbol.

Handy thing, immediately shows errors in TA if there were deals. But on large timeframes icons, already obscure the candles.

 
How to get by using the code, to change the properties,"Show trades on chart in real time".
 
BillionerClub:
How to get with the code, to change the properties,"Show trades on the chart in real time".

I have not checked, but maybe this?

  • CHART_SHOW_TRADE_LEVELS - property to display trade levels (levels of open positions, Stop Loss, Take Profit and pending orders) on the chart.
//+------------------------------------------------------------------+
//| Функция определяет, отображаются ли на графике торговые уровни.  |
//+------------------------------------------------------------------+
bool ChartShowTradeLevelsGet(bool &result,const long chart_ID=0)
  {
//--- подготовим переменную для получения значения свойства
   long value;
//--- сбросим значение ошибки
   ResetLastError();
//--- получим значение свойства
   if(!ChartGetInteger(chart_ID,CHART_SHOW_TRADE_LEVELS,0,value))
     {
      //--- выведем сообщение об ошибке в журнал "Эксперты"
      Print(__FUNCTION__+", Error Code = ",GetLastError());
      return(false);
     }
//--- запомним в переменную значение свойства графика
   result=value;
//--- успешное выполнение
   return(true);
  }
//+------------------------------------------------------------------+
//| Функция включает/выключает режим отображения торговых уровней.   |
//+------------------------------------------------------------------+
bool ChartShowTradeLevelsSet(const bool value,const long chart_ID=0)
  {
//--- сбросим значение ошибки
   ResetLastError();
//--- установим значение свойства
   if(!ChartSetInteger(chart_ID,CHART_SHOW_TRADE_LEVELS,0,value))
     {
      //--- выведем сообщение об ошибке в журнал "Эксперты"
      Print(__FUNCTION__+", Error Code = ",GetLastError());
      return(false);
     }
//--- успешное выполнение
   return(true);
  }
 

Good morning. Can you tell me how to open a link in a browser in MQL5? When I click on the button, it needs to open browser and click on the link. The code below gives out errors.

#import "shell32.dll"
   int ShellExecuteW(int hWnd,int lpVerb, string lpFile,string lpParameters,int lpDirectory,int nCmdShow);
#import

 ShellExecuteW(NULL, "Open", "explorer.exe", "\"https://mql5.com\"", NULL, 1);
 
Alexander Mikryukov:

Good morning. Can you tell me how to open a link in a browser in MQL5? When I click on the button, it needs to open browser and click on the link. The code below generates errors.

Check theShellExecuteW parameters

in the function prototype, the 2nd parameter has the INT type, and you are passing the string....

Added

It should be like this in the prototype

HINSTANCE ShellExecuteW(
  HWND    hwnd,
  LPCWSTR lpOperation,
  LPCWSTR lpFile,
  LPCWSTR lpParameters,
  LPCWSTR lpDirectory,
  INT     nShowCmd
);
So your prototype is not described correctly
 
prostotrader:

Check theShellExecuteW parameters

In the prototype function, the 2nd parameter is of INT type, and you are passing the string....

Added by

It should be so in the prototype.

So your prototype is not described correctly

Thanks, it worked.

 

Good afternoon, the function to switch on programmatically is

IndicatorSetDouble(INDICATOR_MAXIMUM,v);


and how do you switch it off programmatically?


 
When debugging on historical data, how do I load the right set to the EA?
Reason: