Dear All
When I test a new trading strategy I open a chart with 5min data , apply a signal and also a propietray indicator that exports information like an equityline or something else to a folder . A second software uses that file for further calculations. While MC is open I cannot delete that exported file because it is somehow locked by MC. (see attachment)
Lets take a simple example as an indicator:
if BarNumber = 1 then
begin
FileDelete("c:/mctrades/"+symbol+".txt");
FileAppend("c:/mctrades/"+symbol+".txt","123");
end;
This indicator creates a file that I cannot delete anymore while MC is open. I have to close MC to be able to delete that file. In older versions of MC that was possible but now does not work anymore. How can resolve this ?
Exported file from indicator gets locked by MC [SOLVED]
Exported file from indicator gets locked by MC
- Attachments
-
- ScreenHunter 1172.jpg
- (61.66 KiB) Not downloaded yet
- Polly MultiCharts
- Posts: 218
- Joined: 20 Jul 2022
- Has thanked: 1 time
- Been thanked: 59 times
Re: Exported file from indicator gets locked by MC
Hello amadeu1,
In order for a file to be deleted, its descriptor should be closed. Please use FileClose to close a file descriptor. It closes the handle of the specified file, which allows for opening it from a different application for writing.
In order for a file to be deleted, its descriptor should be closed. Please use FileClose to close a file descriptor. It closes the handle of the specified file, which allows for opening it from a different application for writing.