Login Page - Create Account

Support Board


Date/Time: Wed, 15 May 2024 12:11:59 +0000



Error in backtest for target order when trail stop is used

View Count: 1057

[2018-05-17 13:48:06]
User470516 - Posts: 78
Dear SC Team,

I have written a trading strategy that uses attached orders defined on the trade window. I am using the DAX Future.

I backtest this strategy using (i) replay backtest and (ii) bar based backtest. I use a target limit order offest equal to 30 ticks and a stop or trail stop with an offset also equal to 30 ticks.

(i) When using the replay backtest or the replay, it appears that he P&L of a winning trade regularly exceeds the 30 ticks limit and is equal to 31 ticks which is impossible.

Also sometimes the trade activity log reports runups or drawdowns in excess of 1000 Dax Future points! I am aware of the documentation "Notes about Runup, Drawdown, Maximum Open Position Profit/Loss, Entry Efficiency, Exit Efficiency, Total Efficiency fields". It says: "If you are performing simulated trading and a Trade has spanned both a replay and real-time data, this can definitely cause inaccuracy with the Runup, Drawdown, ..." Although I do not undestand what is meant by "a Trade has spanned both a replay and real-time data" (could you explain please?), I would like to check with you if you believe that such errors fall into the category of inaccurate calculations dealt with in those Notes of the Documentation?

(ii) when using the bar based back test and a stop and target, backtesting calculation are fine except for the above mentionned runup and drawdown errors. However if I use a trailstop instead of a plain stop, almost 100% of the winning trades enjoy a profit that by far exceeds what is technically possible with the target set at an offset of 30 ticks. Would you have hints about what is happening or is it an misfunctionning?

Thank you for you support.

Regards,

Laurent
[2018-05-17 19:45:26]
User470516 - Posts: 78
I would like to add a precision to (i) in the previous post: Sierra Chart correctly returns "High and Low Price While Open" values contained in the trade tab of the Trade Activity Log, which explains why I do not understand Runup and Drawdown errors.
regards,
Laurent
[2018-05-18 04:04:51]
Sierra Chart Engineering - Posts: 104368
Although I do not undestand what is meant by "a Trade has spanned both a replay and real-time data" (could you explain please?),
We have reworded this in the documentation to make it more clear.

Tell us the time zone you are using in Sierra Chart.

Provide the Trade Activity Log following these instructions here:
http://www.sierrachart.com/index.php?page=doc/TradeActivityLog.php#TradeActivityLogFileToSupport

And tell us the settings you have set at the top of the Trade Activity Log.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2018-05-18 04:05:25
[2018-05-18 04:07:27]
Sierra Chart Engineering - Posts: 104368

(i) When using the replay backtest or the replay, it appears that he P&L of a winning trade regularly exceeds the 30 ticks limit and is equal to 31 ticks which is impossible.
In regards to this, refer to:
http://www.sierrachart.com/index.php?page=doc/TradeSimulation.php#HowOrdersAreFilled
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2018-05-27 17:58:54]
User470516 - Posts: 78
Dear SC Team,

Thank you for your response and support.

I am based in Paris, France. My time zone therefore is Paris/Brussel, ie currently CEST (UTC+2h).

I think I have made a mistake trying to send a screen shot of the trade activity log window. Please discard it. Here are the settings for the log:
- all internal order IDs
- Sim DYM18
- long & short
- all notes
- from 2018-05-07 08:00:00 to 2018-05-25 21:00:01
- fil to fill
- currency value

In the trade window, the settings are: target and stop = 30ticks(375C). Trailing stop option (which creates the problem). "use attached orders" activated. There should not be any profit exceding 375/387.

I attach the TradeActivityLog.dat as requested.

FYI I have coded the trailing stop and I do not have that problem. Only when using trade window.

Thank you.

Regards,

Laurent
Private File
[2018-06-04 09:48:28]
Sierra Chart Engineering - Posts: 104368
We will be looking this over, this week. For the record we only see 4 order fills in this log with a quantity of 1 each.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account