printing vlariables

How to create strategies and indicators
Message
Author
allan21
Posts: 5
Joined: Mon Oct 08, 2007 4:53 am

printing vlariables

#1 Postby allan21 » Fri Oct 12, 2007 6:09 am

Hi Terranin,

thanks a lot for answering my previous question.
I need one more thing, I have compiled a program/strategy in Delphi and I'm running in Forextester.

I'm using some conditions based on the vlaue of let's say parameter1 and parameter2.

I need to view the vlaue of those paramters in order to see if my condition is met or no. How can I output the value of those paramters to a log file. Should I use print, writeln... what's the syntax. My paramters are of type double.

Thanks in advance!

User avatar
Terranin
Site Admin
Posts: 833
Joined: Sat Oct 21, 2006 4:39 pm

Re: printing vlariables

#2 Postby Terranin » Fri Oct 12, 2007 7:22 pm

allan21 wrote:Hi Terranin,

thanks a lot for answering my previous question.
I need one more thing, I have compiled a program/strategy in Delphi and I'm running in Forextester.

I'm using some conditions based on the vlaue of let's say parameter1 and parameter2.

I need to view the vlaue of those paramters in order to see if my condition is met or no. How can I output the value of those paramters to a log file. Should I use print, writeln... what's the syntax. My paramters are of type double.

Thanks in advance!


For this purpose use function Print()

Example:
Print(format('Parameter1 = %.4f', [parameter1]));

Result in log file:
Parameter1 = 1.7453

Example:
Print(format('Parameter1 = %.2f, but Parameter2 = %d', [parameter1, parameter2]));

Result in log file:
Parameter1 = 2.35, but Parameter2 = -11

(Parameter2 should be integer)

%.4f - print double with 4 digits after point
%d - print integer
%s - print string
Hasta la vista
Mike


Return to “FT API”

Who is online

Users browsing this forum: No registered users and 15 guests