Help with script - account data

 

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.

 
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.
 
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.
 
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.
 
Code base is one place to start.
 
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
Reason: