Hello to dev team,
I programmed an indicator which records some values inside this indicator
With SDK 2.3.1 : all is OK the datas are well recorded,
BUT with SDK 3.0, I obtain this error (in the "Output" tab :
The code :
function Init()
...
indicator.parameters:addGroup("Record Signals");
indicator.parameters:addBoolean("SetRecording", "Activate Signals Recording", "", true);
indicator.parameters:addString("File", "File Name", "", "\\Data Recording\\Rec_ZZ_SemaforFast_v1.csv");
...
end
-- Variables for recording signals
local FileRec;
local Record;
local Title;
local ShowAlert;
local Compteur = 0;
function Prepare()
...
Record = instance.parameters.SetRecording;
if Record then -- TODO : Add a tick counter like cpteur = cpteur+1 for column "Chrono"
FileRec = io.open(instance.parameters.File, "a+");
if FileRec ~= nil then
Title = "Recording Stated" .. '\n';
Title = Title .. "Chrono" .. ";" .. "Date Hour" .. ";" .. "period" .. ";" .. "Search_Mode" .. ";" .. "Last_Peak" .. ";" .. "Open" .. ";" .. "High" .. ";" .. "Low" .. ";" .. "Close" .. '\n';
FileRec:write(Title);
FileRec:flush(FileRec);
else
if ShowAlert then
assert(FileRec, "FileRec == Nil")
end
end
end
end
Question : the error appears at the calling of method FileRec:flush(FileRec) ?
Why the variable "Title" is correctly recorded in the .csv file and not the following ?
The command in Bold is the line 87 of the indicator (see attached .png)
Thanks for help