Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1071

 
Igor Makanu:

I wanted to spread the classes across 2 inludes, but I can't get rid of the problem of usingenum in both .mqh files

there's file 1.mqh:

and file 2.mqh:

When I attach it to the main code, I get an error

enumeration already defined 2.mqh

see previous declaration of'ENUM_DEAL_TYPE'

As far as I understand "Conditional compilation (#ifdef, #ifndef, #else, #endif)" directive is needed - never had any experience here, it goes hard ((.

You can put all the enums in a separate .mqh and connect it to all the necessary inludes and other code.

 
Alexey Viktorov:

You can put all the enums in a separate .mqh and connect it to all the necessary inludes and other code.

I know, I don't want to include the whole file because of one enum, and in input variables I use the same enum, in general, it is not convenient yet

There must be something similar in the standard library - how to use conditional compilation, I do not want to look through all the files, so I hope for help

 
Igor Makanu:

I know, I don't want to include the whole file because of one enum, and in input variables I use the same enum, in general, it's not convenient yet

Most likely there should be something similar in the standard library - how to use conditional compilation, I do not want to look through all the files, so I hope for help

The logic is simple: if not set - set. But you will have to write it in every file.
 
Artyom Trishkin:
The logic is simple: if not specified - specify. But we'll have to prescribe it in each file.

It works with #define, no problem:

#ifndef  EA_Slippage 
   #define  EA_Slippage  30 
#endif

but with types it does not want to work, as an option to write something with define - #ifndef in the body of which something to define ... I don't know how, I've never used it that's why I'm asking how

 
Igor Makanu:

I know, I don't want to include the whole file because of one enum, and in input variables I use the same enum, in general, it's not convenient yet

There should probably be something similar in the standard library - how to use conditional compilation, I do not want to look through all the files, so I hope for help

It's not like I'm carrying sacks.

 
Alexey Viktorov:

Well, it's not like carrying sacks.

if everything was measured in bags....

I've done it, I need to write such an expression at the beginning of each inluder and in the main program:

#ifndef  ENUMDEALTYPE 
   #define  ENUMDEALTYPE
   enum        ENUM_DEALTYPE{NONE,BUY,SELL};
#endif

then the order of the files doesn't matter and everything compiles without problems.

 
Igor Makanu:

if everything was measured in bags....

I've done it, I need to write such an expression at the beginning of each inluder and in the main program:

then the order of the files is irrelevant and everything compiles without problems

That's what I'm talking about.
 

Hello !

The 12 charts in MT5 do not reflect (do not visualise) the deal objects in normal automatic trading,

With trades reflected in the "Trade" section. I would like to understand the reason for such charts, Please enlighten me ?

I WOULD REALLY APPRECIATE IT.

 
akarustam:

Hello !

The 12 charts in MT5 do not reflect (do not visualise) the deal objects in normal automatic trading,

With trades reflected in the "Trade" section. I would like to understand the reason for such charts, Please enlighten me ?

THANK YOU.

Check Settings in the terminal: Settings - Trading
  • Show deals on the chart in real time- if this option is enabled, all deals performed by the trader will be automatically marked on the chart with the corresponding iconsBuying(buy deal) andFor sale(sell deal). When putting the mouse cursor over such an icon, a tooltip with information about the deal will be displayed: ticket, deal type, volume, symbol, opening price and price at the cursor point.

 
Vladimir Karputov:
Check the settings in the terminal: Settings - Trade
  • Show trades on the chart in real time- if this option is enabled, all trades performed by the trader will automatically be marked on the chart with an appropriate icon (buy deal) and (sell deal). If you put the mouse cursor over such an icon, a tooltip containing the information about the deal will appear: ticket, deal type, volume, symbol, opening price and the price at the cursor point.

THANK YOU.

I have checked and manipulated differently, I have seen all deal objects, but on all 12 currency pairs, except EURUSD, horizontal-moving, dashed lines of deals with indication of deal type and number still do not appear, while on EURUSD all objects and lines are clearly marked, including manual placing of orders. I blame the Windows 10 update because I placed orders on EURUSD chart before the update. I don't know what to do now, of course I can change my MT4 vision habit, but is there a button that lets me mark lines at last?