How EA can rean file written to from an Indicator

 

Hello,

I have an EA that triggers an indicator. In that in that indicator I write to a file a number of values that I calculate. Then when the indicator is complete and return is passed back to the EA. I want to read that file and analyze the values that were written by the indicator.

I can't seem to get the file to open, then write and close and then open and read in the EA. Does anyone have an example I could look at?

 
bjoost:
I have an EA that triggers an indicator. In that in that indicator I write to a file a number of values that I calculate. Then when the indicator is complete and return is passed back to the EA.

No you don't. When a tick comes in, ALL indicators are updated. THEN, each idle EA is called. Your iCustom call just reads out of the indicator's buffer, there is NO delay, the EA continues immediately.

Since indicator's run in the terminal's GUI thread, that is why they can NOT sleep or delay.

Make sure the indicator has written and closed the file, or the EA will not be able to open it.

If there are only a few "number of values," use global variables and avoid the problem.

 
you may also consider an external tool like permvar as alternative for this job. you may google for it.
 
fx1.net:
you may also consider an external tool like permvar as alternative for this job. you may google for it.
Can you PLEASE stop your relentless Advertising . . . . Forum rules do not permit it.
 
WHRoeder:

No you don't. When a tick comes in, ALL indicators are updated. THEN, each idle EA is called. Your iCustom call just reads out of the indicator's buffer, there is NO delay, the EA continues immediately.

Since indicator's run in the terminal's GUI thread, that is why they can NOT sleep or delay.

Make sure the indicator has written and closed the file, or the EA will not be able to open it.

If there are only a few "number of values," use global variables and avoid the problem.


thank you for your reply. It has taken me awhile to get back to my coding. i see now how the indicator executes...You suggest using of Global variables, is that in place of writing to a file? I could use global variables to pass data from the icustom indicator to the EA????

also; If I create a file in the icustom indicator it should write to the directory: Terminal_folder\Experts \Files\ correct?

Reason: