Error on changing the time period of a strategy

Bug reports and errors in the program
Message
Author
Smilie10
Posts: 5
Joined: Tue Mar 17, 2015 12:02 am

Error on changing the time period of a strategy

#1 Postby Smilie10 » Thu Mar 26, 2015 8:37 am

I have a strategy that allows me to activate the time period where it can place order automatically when a valid signal is generated, yet everytime when I try to change the "from" and "to" time range, it returns an error "An error occurred i the application" and I have the choice to continue, restart or close the application. My programmer tells me that it can't handle string.

FX Helper
Posts: 1479
Joined: Mon Apr 01, 2013 3:55 am

Re: Error on changing the time period of a strategy

#2 Postby FX Helper » Thu Mar 26, 2015 9:59 am

Hello,

Does your programmer uses this procedure

RegOption('Timeframe', ot_TimeFrame, Timeframe);

for timeframe selection?

Or he uses som other procedure? This can be the reason of the issue.

Can you please send a source code so we can try to find the reason of the issue in code?

Smilie10
Posts: 5
Joined: Tue Mar 17, 2015 12:02 am

Re: Error on changing the time period of a strategy

#3 Postby Smilie10 » Thu Mar 26, 2015 10:53 am

Hi,

Here is the source code from my programmer.

var

FromTime: String;
ToTime: String;

procedure InitStrategy; stdcall;
begin

RegOption('FromTime', ot_String, FromTime);
FromTime:= '08:00:00' ;

RegOption('ToTime', ot_String, ToTime);
ToTime:= '22:00:00' ;





procedure GetSingleTick; stdcall;
var

ToTime1 : TDateTime;
TimeNow : TDateTime;
Comm,formattedDate : string;


begin

FromTime1 := StrToTime(FromTime) ;
ToTime1 := StrToTime(ToTime) ;

DateTimeToString(formattedDate, 't', TimeCurrent);
TimeNow := StrToTime(formattedDate) ;

Thanks.

FX Helper
Posts: 1479
Joined: Mon Apr 01, 2013 3:55 am

Re: Error on changing the time period of a strategy

#4 Postby FX Helper » Fri Mar 27, 2015 8:40 am

Hello,

Please try to set

FromTime: PChar = nil;
ToTime: PChar = nil;

instead of

FromTime: String;
ToTime: String;

If this doesn't help then please try

FromTime: PANSIChar = nil;
ToTime: PANSIChar = nil;

Smilie10
Posts: 5
Joined: Tue Mar 17, 2015 12:02 am

Re: Error on changing the time period of a strategy

#5 Postby Smilie10 » Sat Mar 28, 2015 8:39 am

unfortunately, it doesn't work. The same error message as before. Please advise, thanks.

FX Helper
Posts: 1479
Joined: Mon Apr 01, 2013 3:55 am

Re: Error on changing the time period of a strategy

#6 Postby FX Helper » Tue Mar 31, 2015 10:00 am

Hello,

Can you please send a source code and .dll file to email support@forextester.com ? We will try to find the reason of this issue.


Return to “Bug reports”

Who is online

Users browsing this forum: No registered users and 5 guests