Syntax problem

How to create strategies and indicators
Message
Author
SquareMeal
Posts: 40
Joined: Wed Sep 15, 2010 6:52 am

Syntax problem

#1 Postby SquareMeal » Sat Sep 18, 2010 11:28 am

I'm using Lazarus to write and compile my first strategy (strategyname.dpr).

I copied StrategyInterfaceUnit from ForexTester folders into my lazarus\projects\ folder.

When I try to compile, I'm getting a lot of syntax errors within StrategyInterfaceUnit (even though I set the compiler option syntax to "Delphi").

I tried remarking out { } the statements with FATAL errors since I knew I didn't need that logic and I wanted to try to get through the compile for the first time.

One such FATAL error was:
Fatal Syntax error, ")" expected but "identifier POINT" found.

The code within the StrategyInterfaceUnit being referred to is:
result := round((OrderOpenPrice - OrderStopLoss)/info.Point);

After remarking out the FATAL errors, the compile still failed because there were more than 50 syntax errors.

Examples of some of those errors:
Illegal type conversion: "ShortString" to "^Char"
Incompatible types: got "<procedure variable type of function:Double of object;StdCall>" expected "Double"

I have a feeling I may have copied in the wrong StrategyInterfaceUnit or I don't have Lazarus set up to correctly to recognize the syntax.

Any help would be appreciated.

Thanks,
SquareMeal
creativity + willful purpose

FT Support
Posts: 905
Joined: Sat Jul 11, 2009 10:54 am

#2 Postby FT Support » Sat Sep 18, 2010 2:49 pm

Can you please post your strategy?
Check our other product here:
http://www.forexcopier.com

SquareMeal
Posts: 40
Joined: Wed Sep 15, 2010 6:52 am

syntax errors during lazarus compile

#3 Postby SquareMeal » Sat Sep 18, 2010 4:02 pm

I posted my source code, but then decided to delete it so I won't waste any of your time on this.

I went to the Wiki site for Lazarus documentation and was able to learn the meaning of each file type and where my source code for a strategy should be placed for compiling. What threw me off was trying to apply the lazarus video for developing an indicator to writing a strategy -- a lot is the same, but there are subtle differences.

I will post again when I have a specific problem, but so far so good.

Regards,
SquareMeal
creativity + willful purpose


Return to “FT API”

Who is online

Users browsing this forum: No registered users and 22 guests