DIGIT AFTER POINT for external parameter

How to create strategies and indicators
Message
Author
Phil_Trade
Posts: 94
Joined: Tue Jan 31, 2012 5:14 am
Contact:

DIGIT AFTER POINT for external parameter

#1 Postby Phil_Trade » Tue Feb 28, 2012 2:35 am

Hello

I need external parameter with 3 ou 4 digit after point. But when I set them in the parameter window 0.995 give 0.99 and 0.996 give 1.00 ?
it seems to be rounded to 2 digits !

Is there a way to specify the number of digit ?

This an example with strategy builder.

//--------------------------------------------------------------------------
// Some info
//--------------------------------------------------------------------------
library DemoStrategy;

uses
StrategyInterfaceUnit, TechnicalFunctions;

var
// external parameters
AZERTY: double = 0.998;

// internal variables


{-----Init strategy----------------------------------------------------------}
procedure InitStrategy; stdcall;
begin
StrategyShortName('Demo strategy');
StrategyDescription('This strategy does something');

RegOption('AZERTY', ot_Double, AZERTY);
end;

{-----Done strategy----------------------------------------------------------}
procedure DoneStrategy; stdcall;
begin
//
end;

{-----Reset strategy---------------------------------------------------------}
procedure ResetStrategy; stdcall;
begin
//
end;

{-----Process single tick----------------------------------------------------}
procedure GetSingleTick; stdcall;
begin
//
end;

exports
InitStrategy, DoneStrategy, ResetStrategy, GetSingleTick;

end.
my live account - 8 based pairs with optimized parameters : +188%
http://www.myfxbook.com/members/Philipp ... jpg/519044
TradeSlide : http://bit.ly/14R9Nf6

to be informed about Windev/MT4 services : a04486-tradingsignal@yahoo.fr

FxMax
Posts: 9
Joined: Mon Nov 28, 2011 10:49 am

#2 Postby FxMax » Tue Feb 28, 2012 3:46 am

please use this:

Code: Select all

RegOption('AZERTY', ot_Double, AZERTY);
SetOptionDigits('AZERTY', 4);

Phil_Trade
Posts: 94
Joined: Tue Jan 31, 2012 5:14 am
Contact:

#3 Postby Phil_Trade » Tue Feb 28, 2012 8:03 am

FxMax wrote:please use this:

Code: Select all

RegOption('AZERTY', ot_Double, AZERTY);
SetOptionDigits('AZERTY', 4);


thks ! the tools strategy builder need to be updated !
my live account - 8 based pairs with optimized parameters : +188%

http://www.myfxbook.com/members/Philipp ... jpg/519044

TradeSlide : http://bit.ly/14R9Nf6



to be informed about Windev/MT4 services : a04486-tradingsignal@yahoo.fr


Return to “FT API”

Who is online

Users browsing this forum: No registered users and 22 guests