Delphi trading backtesting code

Hi All,

I am not sure if this is the best place to post this question, but I really need some help with regards to a relatively simple code. It is part of a DLL and when compiled I run it through a Forex trading backtesting software.

I have the code running, I would just like it to execute orders when an indicator reaches a certain value, should I post the code here or somewhere else on the forum?

Not really sure why you would have that kind of problem. You can run a timer to check the ATR value at specified interval and when ATR value reaches 50% (or more) you execute codes that place order.

Use a TTimer, specify interval that you want, and in its OnTimer you check the current ATR value and when it's 50% or more you place order. Make sure the timer is enabled, otherwise the OnTimer will never be fired.

Not really sure why you would have that kind of problem. You can run a timer to check the ATR value at specified interval and when ATR value reaches 50% (or more) you execute codes that place order.

Use a TTimer, specify interval that you want, and in its OnTimer you check the current ATR value and when it's 50% or more you place order. Make sure the timer is enabled, otherwise the OnTimer will never be fired.

Thanks for the response. I have entered the ATR code correctly ( I believe), but it does not seem to be working, could you please tell me how to specify and use a TTimer in the code? Sorry, I am very new to Delphi.

If you are using a form, you can just drop a TTimer to your form (let's say that the instance is named Timer1), set its interval to 1000 (1second) and enabled to true. Double click on it and its OnTimer event handler will be generated. Of course initially the event handler will be empty. It's your job to put codes that do the ATR checking and place the order inside this event handler.

If you want to do all in code, e.g. you don't use Form or DataModule, you can use something like this:

Unfortunately no. In the past I have tried to win some of similar applications contracts, but never succeeded. So my experience in this particular field is nearly zero. However the programming should not be that hard or that different with other network related applications.