I included the library but the variable still gives error??? why?

 

hi

I included this library:


#include <Trade\Trade.mqh>


but when using this variable:


FreeMargin()


this error eppears:



what is wrong ?????

 

Google asked to search for site:mql5.com #include <Trade\Trade.mqh> would habe brought you this:

https://www.mql5.com/en/forum/338486

How to useTrade.mqh library in mql5?
How to useTrade.mqh library in mql5?
  • 2020.04.24
  • www.mql5.com
#include CTrade trade; I am new to mql. I have seen the code above in *** but there are parts I do not understand...
 
Carl Schreiber #:

Google asked to search for site:mql5.com #include <Trade\Trade.mqh> would habe brought you this:

https://www.mql5.com/en/forum/338486

Still dont understand ....


when I use this:

class CAccountInfo : public CObject

It says identifier already used ... (CAccountinfo)

but, FreeMargin still gives error. 

Why=?

 
Javier Santiago Gaston De Iriarte Cabrera:

why use CTrade?

AccountInfoDouble(ACCOUNT_MARGIN_FREE)
 
Javier Santiago Gaston De Iriarte Cabrera #:

Still dont understand ....


when I use this:

It says identifier already used ... (CAccountinfo)

but, FreeMargin still gives error. 

Why=?

You can write but not read? Amazing!

The example of the link has no

class CAccountInfo : public CObject

FreeMargi() is not a MQL5 function recognizable by the fact that it is not highlighted in color.

So it has to be declared and properly 'filled'.

Otherwise you would be able to place the cursor on that and press F1 and your are directly taken to the reference - arrgh, again something to read for you :(

Here is the list of al MQL5 function there you can search for keyword e.g. like margin: https://www.mql5.com/en/docs/function_indices

Documentation on MQL5: List of MQL5 Functions
Documentation on MQL5: List of MQL5 Functions
  • www.mql5.com
List of MQL5 Functions - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5