Display strategy internal variables

All posts which do not fit into any other sections of the forum.

Moderator: admin

Display strategy internal variables

Postby MaximT » Tue May 15, 2018 5:51 am

Hi all!

What is the simplest way to display an internal runtime variables of the strategy? Is the only way is to use special indicator and interop between indicator and strategy?
MaximT
 
Posts: 3
Joined: Wed Jun 29, 2016 2:13 am

Re: Display strategy internal variables

Postby Apprentice » Wed May 16, 2018 4:26 am

Code: Select all
core.host:trace("Add a message here.");


In the debugger the trace will be written to the output pane of the debugger. In Marketscope the trace will be written to the "trace" tag of the strategies/indicator log pane.


ExtTrace("Some Note");

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
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 19567
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia


Return to General Discussions

Who is online

Users browsing this forum: No registered users and 4 guests