Error on changing the time period of a strategy
-
- Posts: 5
- Joined: Tue Mar 17, 2015 12:02 am
Error on changing the time period of a strategy
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.
-
- Posts: 1479
- Joined: Mon Apr 01, 2013 3:55 am
Re: Error on changing the time period of a strategy
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?
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?
-
- Posts: 5
- Joined: Tue Mar 17, 2015 12:02 am
Re: Error on changing the time period of a strategy
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.
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.
-
- Posts: 1479
- Joined: Mon Apr 01, 2013 3:55 am
Re: Error on changing the time period of a strategy
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;
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;
-
- Posts: 5
- Joined: Tue Mar 17, 2015 12:02 am
Re: Error on changing the time period of a strategy
unfortunately, it doesn't work. The same error message as before. Please advise, thanks.
-
- Posts: 1479
- Joined: Mon Apr 01, 2013 3:55 am
Re: Error on changing the time period of a strategy
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.
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.
Who is online
Users browsing this forum: No registered users and 17 guests