How to write code run file script when pressed button?

To add comments, please log in or register
tae8332
12
tae8332  
I'm a beginner. I create EA  I want create  button click to run the script. How to write?

Help me please. Thank you.
kypa
972
kypa  

OnInit

if(ObjectFind(Button)<0) ObjectCreate(Button)

ObjectSet*(Whatever you want the Button to look like)

OnChartEvent

if(id==ObjectClick && sparam=Button)

<your script as a function>

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
Reads from the file of the CSV type a string of one of the formats: "YYYY.MM.DD HH:MM:SS", "YYYY.MM.DD" or "HH:MM:SS" - and converts it into a datetime value
To add comments, please log in or register