Get "balance", "leverage", "sum last 5-10 historie", "minimal lot size".. own management indicator

 

Hi im developing some money management indicator, im new to this programming language but as Webdeveloper i should be fine to get this indicator rdy.

But i need to fetch some global values if possibile.

I wasnt able to find a list of predefined values, if someone could share me a link to everything available please.


At the moment i need the following values:

-The current effective balance (changing one)

-The leverage of the symbol (if i change chart view to another symbol wich has another leverage it should change)

-The last ~5-10 historie trades profit/loss summed together.

-The minimal Lot size wich can used for the actual chart symbol and the minimal step 

 
  1. Daniel: I wasnt able to find a list of predefined values, if someone could share me a link to everything available please.
    Perhaps you should read the manual.
              MQL5 Reference → Predefined Variables

  2. Daniel:
    -The current effective balance (changing one)
    -The leverage of the symbol (if i change chart view to another symbol wich has another leverage it should change)
    Perhaps you should read the manual.
              MQL5 Reference → AccountInfoDouble → ENUM_ACCOUNT_INFO_DOUBLE → ACCOUNT_BALANCE
              MQL5 Reference → AccountInfoInteger → ENUM_ACCOUNT_INFO_INTEGER → ACCOUNT_LEVERAGE

  3. Daniel: -The last ~5-10 historie trades profit/loss summed together.
    Do not assume history has only closed orders.
    Do not assume history is ordered by date, it's not.
              Could EA Really Live By Order_History Alone? (ubzen) - MQL4 programming forum
              Count how many lost orders from the last profit order - MQL4 programming forum
 

@William Roeder

Hi and thanks a lot for your fast reply.

I guess account_leverage would be the wrong, because on bitcoin i have a leverage of 2 even tough my account leverage is 30.

The minimal lot size and lot step i can read out too ?



Edit:

Everything should be here and in Symbol proporties:

https://www.mql5.com/en/docs/constants/environment_state/accountinformation

Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Account Properties
Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Account Properties
  • www.mql5.com
There are several types of accounts that can be opened on a trade server. The type of account on which an MQL5 program is running can be found out using the ENUM_ACCOUNT_TRADE_MODE enumeration. In case equity is not enough for maintaining open positions, the Stop Out situation, i.e. forced closing occurs. The minimum margin level at which Stop...
 
Daniel: The minimal lot size and lot step i can read out too ?
What part of

"Perhaps you should read the manual."

was unclear?
 
William Roeder:
What part of

"Perhaps you should read the manual."

was unclear?

Sorry but its not easy to find those things in the manual. One of the badest manuels i came incross as programmer oO.

I edited at the end of my post that i found everything then, no reason to get angry ;D.


I do also checked your code to get the latest trades, but its not working. Overall its for mt4 and there are missing many functions u were using as it look like.

Its the last thing i need for my moneymanagment indicator/function.
 
Daniel:

Sorry but its not easy to find those things in the manual.

no reason to get angry

I do also checked your code to get the latest trades, but its not working.

Overall its for mt4 and there are missing many functions u were using as it look like.Its the last thing i need for my moneymanagment indicator/function.

  1. Stop trying to find things and read the hole thing. You couldn't find:
    1. Get … list of predefined values @ MQL5 Reference → Predefined Variables
    2. Get … current effective balance @ MQL5 Reference → Account Information
    3. Get … leverage of the symbol
    4. Get … #2 minimal lot size and lot step @ MQL4 Reference → Market Info → Symbol Properties

  2. Angry? You wasted hundreds hundreds of peoples time with your questions that you should already know, or could have found by using the search. I happen to be the only one willing to get you started. But you continue to repeatedly ask the same types of things. Stop being lazy, stop making excuses. Three times: RTFM then ask your questions.

  3. "Doesn't work" is meaningless - just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires - meaningless. We can't see your broken code. There are no mind readers here and our crystal balls are cracked.

  4. What missing functions? There are no mind readers here and our crystal balls are cracked.

  5. Moneymanagment (SIC), you didn't ask that here before, but you already asked and was answered at Formula to calculate Lot quantity and lot size - Stop Loss - General - MQL5 programming forum #2. Four times: More wasting of my time, added to my do not help list.
 
William Roeder:
  1. Stop trying to find things and read the hole thing. You couldn't find:
    1. Get … list of predefined values @ MQL5 Reference → Predefined Variables
    2. Get … current effective balance @ MQL5 Reference → Account Information
    3. Get … leverage of the symbol
    4. Get … #2 minimal lot size and lot step @ MQL4 Reference → Market Info → Symbol Properties

  2. Angry? You wasted hundreds hundreds of peoples time with your questions that you should already know, or could have found by using the search. I happen to be the only one willing to get you started. But you continue to repeatedly ask the same types of things. Stop being lazy, stop making excuses. Three times: RTFM then ask your questions.

  3. "Doesn't work" is meaningless - just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires - meaningless. We can't see your broken code. There are no mind readers here and our crystal balls are cracked.

  4. Why did you post your MT4 question in the Root / MT5 Indicators section instead of the MQL4 section, (bottom of the Root page?)
              General rules and best pratices of the Forum. - General - MQL5 programming forum
    Next time post in the correct place. The moderators will likely move this thread there soon.
  5. Why did you post (#2) links to the MT5 documentation?

  6. What missing functions? There are no mind readers here and our crystal balls are cracked.

  7. Moneymanagment (SIC), you didn't ask that here before, but you already asked and was answered at Formula to calculate Lot quantity and lot size - Stop Loss - General - MQL5 programming forum #2. Four times: More wasting of my time, added to my do not help list.


3. I googled a lot of hours and couldnt find this page i posted on #2, it was all i searched for. Then i editet my post and told i found everyhing, as there there was no reason for you to waste your time anymore.

For example if you google "mt5 get balance" you wont find that page i shared above, on php for example if you search something you will get the first page exactly you searched for. Thats what i meaned, with badest manual.

4.The question is for mt5 and was all the time.

6. Missing functions of your mt4 code wich wasnt working for mt5 i meaned.

But its ok im done with everything already, its working better then expected and totally dynamical. To minimize lotsize on multiple history losses isnt as important and can be done very easily manually.

7. The formula, i asked in general section because i tought its better to ask on a new thread and fits better for general, in case anyone searches the formula on google they will find this way better and have not the same problem like me ;D.

Reason: