Download MetaTrader 5
To add comments, please log in or register
All MQL5.community events are grouped together. Have a look at the Wall!
szatek
22
szatek 2014.01.24 10:42 

Hi All,

I was wondering if someone could point me in the right direction. I've got a chart with two horizontal lines I draw manually. The lines are called "up" and "down". Is there any easy way to run a script or indicator (not sure which one to use to be honest) which reads the current value of the line and saves it in a file ?

Any help much appreciated.

Best regards,

Simon Gniadkowski
Moderator
17994
Simon Gniadkowski 2014.01.24 12:28  
szatek:

Hi All,

I was wondering if someone could point me in the right direction. I've got a chart with two horizontal lines I draw manually. The lines are called "up" and "down". Is there any easy way to run a script or indicator (not sure which one to use to be honest) which reads the current value of the line and saves it in a file ?

Any help much appreciated.

Best regards,

A Script is intended to run,  do a task and then end.  An Indicator does a task repeatedly.  So if you want to get the levels of the line on an infrequent basis on demand you can use a script,  if you want the file updated in real time when you move the position of the lines then use an Indicator.

You need to familiarise yourself with 2 sets of functions,  File Functions - you will use these to write to the file and Object Functions -  you will use these to get the positions of the lines.  If it's too difficult or you don't have time to learn yu can get this coded for you for a small cost here:  MT4 and MT5 coding jobs
Rogerio Figurelli
Moderator
38831
Rogerio Figurelli 2014.01.29 05:57  
RaptorUK:
A Script is intended to run,  do a task and then end.  

That's right, but you can put a script in a continuous loop, so this would solve the problem, in my opinion, in an easier way than build an indicator.
Simon Gniadkowski
Moderator
17994
Simon Gniadkowski 2014.01.29 10:03  
figurelli:
That's right, but you can put a script in a continuous loop, so this would solve the problem, in my opinion, in an easier way than build an indicator.
And if you want to run a script in addition to this script ?  you cannot . . .  the code is virtually the same in both cases.
Rogerio Figurelli
Moderator
38831
Rogerio Figurelli 2014.01.29 14:31  
RaptorUK:
And if you want to run a script in addition to this script ?  you cannot . . .  the code is virtually the same in both cases.
No problem, just do it in another graph, since you can have several scripts running in the same terminal and account.
/
To add comments, please log in or register