Download MetaTrader 5

Help with script - account data

To add comments, please log in or register
The entire MQL5.community history on a single page!
MateAmargo
34
MateAmargo 2015.07.22 17:19 

Hi. Before anything, english is not my native speaking languaje, so i´m sorry for my grammar mistakes.  I´m trying to make a script for MT5 that do the following:

-Launch when the terminal.exe start.
-Wait until login to broker server.
-Get account balance at the begining of the current day (00.00) or at the first action of the day(buy, sell, etc) from the account history.
- Store that value as Variable 1
-Store a second variable (2), with a customizable value,  0.95
-Get account current equity.
-Do (currentEquity)/Variable1 . If that is equal or less than variable2,  close terminal.exe; if not, do nothing and continue.
-wait x seconds
-Go to start

Possible?

Thanks in advance.

JD4
1101
JD4 2015.07.22 19:49  
Possible?  I would think so, however, many people here will not offer more concrete suggestions unless you show that you are trying to solve the problem yourself first, by posting YOUR attempts with YOUR code (not someone else's efforts).  To do so, use the SRC button at the top to include portions of your code, or the "Attach file" link at the bottom to upload your entire file if it is a big one.
Alain Verleyen
Moderator
30704
Alain Verleyen 2015.07.22 23:48  
MateAmargo:

Hi. Before anything, english is not my native speaking languaje, so i´m sorry for my grammar mistakes.  I´m trying to make a script for MT5 that do the following:

-Launch when the terminal.exe start.
-Wait until login to broker server.
-Get account balance at the begining of the current day (00.00) or at the first action of the day(buy, sell, etc) from the account history.
- Store that value as Variable 1
-Store a second variable (2), with a customizable value,  0.95
-Get account current equity.
-Do (currentEquity)/Variable1 . If that is equal or less than variable2,  close terminal.exe; if not, do nothing and continue.
-wait x seconds
-Go to start

Possible?

Thanks in advance.

Yes it's possible.
MateAmargo
34
MateAmargo 2015.07.23 16:00  
Well, where do i  start? I´m reading the refrence guide, and i find very counter intuitive code language. Years ago I needed to
automate some task with windows os, and used and learned macro scheduler, a macro maker program.
JD4
1101
JD4 2015.07.23 19:37  
Code base is one place to start.
Marco vd Heijden
Moderator
4685
Marco vd Heijden 2015.07.23 23:41  
Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Account Properties
Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Account Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Environment State / Account Properties - Reference on algorithmic/automated trading language for MetaTrader 5
To add comments, please log in or register