How to tell if strategy is paused/finished

How to create strategies and indicators
Message
Author
dackjaniels
Posts: 151
Joined: Tue Feb 24, 2009 1:03 pm

How to tell if strategy is paused/finished

#1 Postby dackjaniels » Wed Aug 17, 2011 8:58 pm

Hi,

As the title says, is there any way to tell if a strategy is paused or testing is finished (no bars left to test) using the API or by overriding an FT procedure?

Thanks,
Steve

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

#2 Postby FT Support » Thu Aug 18, 2011 4:16 am

Hmm, you can pause the strategy execution from the API but we do not have any events or functions that can tell you that the strategy is paused or finished.

Btw why do you need that?
Check our other product here:
http://www.forexcopier.com

dackjaniels
Posts: 151
Joined: Tue Feb 24, 2009 1:03 pm

#3 Postby dackjaniels » Thu Aug 18, 2011 11:47 am

Hi,

Thanks for reply.

I am attempting to improve on some reports that are created automatically as the strategy runs. What I specifically want is the profit/loss of any open trades to be added at the end of the test run.

As we don't know when the test will finish (either via pausing, pressing stop button or running out of data), the only way to get true open P/L figures is to write / rewrite them to the report on every tick. This is proving very processor intensive.

I am working around it by using time functions to identify the last few minutes of a daily bar and updating the report then but its not ideal as Fridays data differs (stops before midnight) and it is not easily transferable to other times frames.

I also think a function to identify the last tick of a bar would be useful.

Regards,
Steve

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

#4 Postby FT Support » Fri Aug 19, 2011 7:13 am

Hello Steve,

Thank you for the explanation.

I think that for now you can use this approach as a work-around:

1) Add "last date" parameter to your strategy which generates reports

2) In the strategy check if "last date" is reached and generate the report at that point.

what do you think?
Check our other product here:
http://www.forexcopier.com

dackjaniels
Posts: 151
Joined: Tue Feb 24, 2009 1:03 pm

#5 Postby dackjaniels » Fri Aug 19, 2011 12:33 pm

Hi,

Thanks for the reply.

I appreciate your suggestion and it would work, but I see some real drawbacks...

1. User has to enter strategy properties each time to enter end date which really breaks the user-flow. It would make sense to me to include end date as an option in the start test dialog (which already includes an optional start date). This end date could then be exposed in the API.

2. It doesn't solve the problem of not knowing when the last tick is executed.

When running my strategy on daily bars updating the report on every tick takes between 10 and 20 seconds to calculate a bar, as using OHLC tick generation means up to 5,760 ticks per daily bar (using real tick data would no doubt be far higher).
This means the last bar would take at least 10 seconds to complete and possibly much longer resulting in FT looking like its crashed. Imagine this on weekly or monthly bars!

Of course I could use the workaround I mentioned in my previous post and check if the tick is somewhere near the end of the bar and start updating the report from there until the end of the bar but this leaves things to chance as there is no way of knowing when the last tick of a bar is going to occur.
It may be one second, minute, 3 hours or 23 hours before midnight on a daily bar depending on day of the week and quality of tick data.

The only way I see of resolving this is to expose in the API a call or preferably an event that is fired on the last tick of each bar. Of course this means that you would have to pre-fetch the next tick and do a time comparison to see if the current tick is the last tick of a bar but this should not be too difficult to implement.

FT is a great tool but has a serious lack of reporting ability when compared to similar tools and I think that implementing a LastTickOfBar API would allow the community to create some excellent reporting tools increasing the value of your product. If we had this we wouldn't even need the EndDate functionality I suggested above.

------------------------------------------------------------------------------

Having said all of the above, I had another thought.
With regards to the improvement of reporting (and probably other things), another option would be to implement a plug-in approach.

Being able to run a complete backtest then simply press a button/menu option in FT to run a plugin that generates a comprehensive report would be great. It also reduces the load of generating a report during testing allowing FT backtests to run at full speed.

I suppose this could also be implemented as an entirely separate application but integration with FT would be sweet!

Any thoughts?

Steve

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

#6 Postby FT Support » Sat Aug 20, 2011 4:09 am

Hello Steve, we'll put "LastTickOfBar " into our ToDo list. But we cannot promise that we'll implement plugins functionality in the nearest future... this seems to be quite complex.
Last edited by FT Support on Sun Aug 21, 2011 6:45 am, edited 1 time in total.
Check our other product here:
http://www.forexcopier.com

dackjaniels
Posts: 151
Joined: Tue Feb 24, 2009 1:03 pm

#7 Postby dackjaniels » Sat Aug 20, 2011 8:34 am

Thank you, much appreciated!


Return to “FT API”

Who is online

Users browsing this forum: No registered users and 31 guests