Forex Tester Forum (Professional Training Software for Traders) Forum Index Forex Tester Forum (Professional Training Software for Traders)

Back to main site   Risk disclosure
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem with lesson 1

 
Post new topic   Reply to topic    Forex Tester Forum (Professional Training Software for Traders) Forum Index -> Programming lessons
View previous topic :: View next topic  
Author Message
timpanogos1



Joined: 29 Sep 2009
Posts: 1

PostPosted: Tue Sep 29, 2009 4:19 am    Post subject: Problem with lesson 1 Reply with quote

I followed your instructions to create the DemoStrategy file on Delphi. I cut and pasted your code into Delphi, saved it, compiled it, then copied the .dll file to the ForexTester folder as you described.

Then I restarted FT and when I open the Strategies window, the name of the Strategy is truncated to "D", and the description is "D".

Here is my code, which I copied from your post:

library DemoStrategy;

uses
SysUtils, StrategyInterfaceUnit, TechnicalFunctions;

procedure InitStrategy; stdcall;
begin
StrategyShortName('DemoStrategy');
StrategyDescription('Demo strategy that does nothing');
end;

procedure DoneStrategy; stdcall;
begin

end;

procedure ResetStrategy; stdcall;
begin

end;

procedure GetSingleTick; stdcall;
begin

end;

exports
InitStrategy,
DoneStrategy,
ResetStrategy,
GetSingleTick;

end.


I am using Delphi 2010, and FT 2.3

Just to see if it would work, I tried the same thing on the '8 hour strategy' you have in your other lesson. The same thing happened. And there was only one parameter available, which was the currency parameter.

Something is not quite right. Could you help me with this?

Thanks,

Brandon
Back to top
View user's profile Send private message
Terranin
Site Admin


Joined: 21 Oct 2006
Posts: 831

PostPosted: Thu Oct 01, 2009 3:04 pm    Post subject: Re: Problem with lesson 1 Reply with quote

timpanogos1 wrote:
I followed your instructions to create the DemoStrategy file on Delphi. I cut and pasted your code into Delphi, saved it, compiled it, then copied the .dll file to the ForexTester folder as you described.

Then I restarted FT and when I open the Strategies window, the name of the Strategy is truncated to "D", and the description is "D".

Here is my code, which I copied from your post:

library DemoStrategy;

uses
SysUtils, StrategyInterfaceUnit, TechnicalFunctions;

procedure InitStrategy; stdcall;
begin
StrategyShortName('DemoStrategy');
StrategyDescription('Demo strategy that does nothing');
end;

procedure DoneStrategy; stdcall;
begin

end;

procedure ResetStrategy; stdcall;
begin

end;

procedure GetSingleTick; stdcall;
begin

end;

exports
InitStrategy,
DoneStrategy,
ResetStrategy,
GetSingleTick;

end.


I am using Delphi 2010, and FT 2.3

Just to see if it would work, I tried the same thing on the '8 hour strategy' you have in your other lesson. The same thing happened. And there was only one parameter available, which was the currency parameter.

Something is not quite right. Could you help me with this?

Thanks,

Brandon


Probably you use Delphi version with Unicode support. So each symbol in string is coded with 2 bytes. Check settings in project and use normal strings.

_________________
Hasta la vista
Mike
Back to top
View user's profile Send private message
msmccray65



Joined: 08 Nov 2009
Posts: 8

PostPosted: Sun Nov 15, 2009 11:32 pm    Post subject: Re: Problem with lesson 1 Reply with quote

Where do I go to do that? I've downloaded the free 30 day Delphi trial to troubleshoot some lazarus problems and have the same Unicode issue.

Thanks,
Michael
Back to top
View user's profile Send private message
Terranin
Site Admin


Joined: 21 Oct 2006
Posts: 831

PostPosted: Sun Nov 15, 2009 11:55 pm    Post subject: Re: Problem with lesson 1 Reply with quote

msmccray65 wrote:
Where do I go to do that? I've downloaded the free 30 day Delphi trial to troubleshoot some lazarus problems and have the same Unicode issue.

Thanks,
Michael



Do not have the latest Delphi version. I think all declarations of "string" there mean wide strings. Try to find in project settings compatibility mode with previous versions of Delphi or replace all string types to AnsiString in API units and use the same strings in your project.

_________________
Hasta la vista
Mike
Back to top
View user's profile Send private message
msmccray65



Joined: 08 Nov 2009
Posts: 8

PostPosted: Mon Nov 16, 2009 3:20 am    Post subject: Re: Problem with lesson 1 Reply with quote

Terranin wrote:
msmccray65 wrote:
Where do I go to do that? I've downloaded the free 30 day Delphi trial to troubleshoot some lazarus problems and have the same Unicode issue.

Thanks,
Michael



Do not have the latest Delphi version. I think all declarations of "string" there mean wide strings. Try to find in project settings compatibility mode with previous versions of Delphi or replace all string types to AnsiString in API units and use the same strings in your project.


If you convert the 'string' variables to 'ANSIstring' it does work with a warning. I couldn't find a compatibility mode on their software. Given the 30 day trial for Delphi 2010, I hope to get Lazarus to work otherwise I'll have to use C++.

Thanks,
Michael
Back to top
View user's profile Send private message
Arnold



Joined: 12 Aug 2012
Posts: 1
Location: South Africa

PostPosted: Sun Aug 12, 2012 1:18 pm    Post subject: Compile error with lesson 1 Reply with quote

Hi

As introduction, this will be my first post inthe forum. I recently bought FT2 because Iwant to backtest some ideas. After reading the first few stickies on the forum I purchased Delphi XE2.

I am following along on th programming lesson 1 and ran into a problem after compiling the forum first lesson. The compiler finds a problem when compiling DemoStrategy , it opens the StategyInterfaceUnit file and redlines a line, (see the attached file), there is also an error message on the bottom.

Maybe one of you guys can tell me how to fix it?
Back to top
View user's profile Send private message
KelvinHand



Joined: 02 Jan 2011
Posts: 90

PostPosted: Tue Aug 28, 2012 6:07 am    Post subject: Re: Compile error with lesson 1 Reply with quote

Arnold wrote:
Hi

As introduction, this will be my first post inthe forum. I recently bought FT2 because Iwant to backtest some ideas. After reading the first few stickies on the forum I purchased Delphi XE2.

I am following along on th programming lesson 1 and ran into a problem after compiling the forum first lesson. The compiler finds a problem when compiling DemoStrategy , it opens the StategyInterfaceUnit file and redlines a line, (see the attached file), there is also an error message on the bottom.

Maybe one of you guys can tell me how to fix it?


I don't use Delphi XE2. but I think problem could be quite simple
"File not found" refer to Library Graphics.DCU.

This indicate the compiler try to search the lib path and could not find the file.


Based on your picture quit similar.
Goto "Tool" -> "Environment options"-> "Library" Tab.
In the directories section Lib Path:

for example:
Check for the variable such as ...$(DELPHI)\Lib; ....

This should point to you library location.

$(DELPHI) is setup in the "Environment Variables" Tab pointing you to the direction of your delphi library

for example:
DELPHI = c:\program files (x86)\borland\delphi7

Examples above is only my configuration, may not be your default.

To confirm the Graphics.DCU is in c:\program files (x86)\borland\delphi7\lib. Do manual check it is in that folder.

And trail by error.

Otherwise seek help from the vendor you brought from.

Hope this help you.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Forex Tester Forum (Professional Training Software for Traders) Forum Index -> Programming lessons All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group