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]
- Polly MultiCharts
- Posts: 264
- Joined: Jul 20 2022
- Has thanked: 1 time
- Been thanked: 67 times
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.