I am tring to make a custom indicator in NT7 write to a text file when all conditions are met, this text file will be monitored every 1 second by another 3rd party program. This is how it works:
1, When all conditions are met, the custom indicator write a new line to the text file, named "output.txt" for example.
2, Every 1 second, the 3rd party open the "output.txt" text file and see if a new line has been written to the file, if yes, then it will read this line into its own platform, and delete the entire content of the "output.txt" text file.
Based on my understanding, there are two methods to write to a text file from Ninjatrader indicators, one is StreamWriter, the other is System.IO File properties.
My question is:
What would happen if when the 3rd party is opening the "output.txt" text file, the NT indicator is trying to open and write to the same file at the same moment? Will there be any conflict or error message? Is there anyway to avoid this?
Thanks.
Comment