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
Problem with lesson 1
- Terranin
- Site Admin
- Posts: 833
- Joined: Sat Oct 21, 2006 4:39 pm
Re: Problem with lesson 1
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
Mike
-
- Posts: 8
- Joined: Sun Nov 08, 2009 12:14 pm
Re: Problem with lesson 1
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
Thanks,
Michael
- Terranin
- Site Admin
- Posts: 833
- Joined: Sat Oct 21, 2006 4:39 pm
Re: Problem with lesson 1
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
Mike
-
- Posts: 8
- Joined: Sun Nov 08, 2009 12:14 pm
Re: Problem with lesson 1
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
-
- Posts: 1
- Joined: Sun Aug 12, 2012 7:29 am
- Location: South Africa
Compile error with lesson 1
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?
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?
- Attachments
-
- Lessen 1 - Compile error.jpg (141.63 KiB) Viewed 12329 times
-
- Posts: 103
- Joined: Sun Jan 02, 2011 6:05 pm
Re: Compile error with lesson 1
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.
Return to “Programming lessons”
Who is online
Users browsing this forum: No registered users and 15 guests