Re: Function Collection
Posted: Wed Jan 28, 2015 7:02 pm
A date and time stamped Trace/Log function.
Very useful when debugging.
For use in strategies.
For use in indicators.
Very useful when debugging.
For use in strategies.
- Code: Select all
function ExtTrace(message)
local theDate = core.dateToTable(core.host:execute("convertTime", 1, 4, math.max(instance.bid:date(instance.bid:size() - 1), instance.ask:date(instance.ask:size() - 1))));
core.host:trace(string.format("%d/%02d/%02d %02d:%02d:%02d ", theDate.year, theDate.month, theDate.day, theDate.hour, theDate.min, theDate.sec) .. " " .. message);
end
For use in indicators.
- Code: Select all
function ExtTrace(message, date)
local theDate = core.dateToTable(core.host:execute("convertTime", 1, 4, date));
core.host:trace(string.format("%d/%02d/%02d %02d:%02d:%02d ", theDate.year, theDate.month, theDate.day, theDate.hour, theDate.min, theDate.sec) .. " " .. message);
end