Login Page - Create Account

Support Board


Date/Time: Wed, 01 May 2024 22:47:39 +0000



TextTag and backtesting

View Count: 663

[2020-02-16 00:18:37]
jmt816 - Posts: 45
In doing backtesting of an ACSIL trading system, like many others have noted in older posts, getting the values of various studies is a critical element for analysis. I used a pipe-delimited format to squeeze data in that can later be unpacked from the download of the TradeActivity log (which has a lot of very useful data elements, right out of the box).
The process, as I understand it (from interactive debugging and documentation) is that the TextTag gets set on s_SCNewOrder. When order is accepted, that gets propagated into the s_SCTradeOrder.
Thus, the values that can be written to TextTag are the values at the time of order SUBMISSION, rather than execution. I have attempted to over-ride the original values, which does not get rejected, but it does not persist. The Note in the TradeActivity log thus contains the values at order submission rather than order execution.

1) Is there a way to be able to update the TextTag so that it flows through to TradeActivity log?
2) Is there a way to also update values for the note at exit, to capture various study values that are relevant at that point?

Of course, coding it all into a custom file is an option, but I don't want to have to reinvent the wheel to accomplish this.
[2020-02-16 09:55:32]
Sierra Chart Engineering - Posts: 104368
In the next release when you modify an order with this function:
Automated Trading From an Advanced Custom Study: Modifying an Order

The text tag that you set will update the order. Therefore, the text tag at the exit will have the updated value.
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
[2020-02-16 13:53:55]
jmt816 - Posts: 45
Thanks for the quick response. I am not positive whether this will address my need, so allow me to walk through and either point out any issues, or hopefully you can correct me and what you've planned will address it. Certainly what you have planned will be helpful for situations where values to be tracked change BEFORE the order gets filled, so that is definitely an enhancement. However, I am asking about how to modify the value AFTER the order is filled, and also to have that flow through to TradeActivityLog.
There are actually 2 parts to my request:
1) modify TextTag at order fill (for an entry order) to populate current study values (the more important) and
2) if possible, to be able to also modify it upon an EXIT order being filled to identify conditions at that point in time.
For both, these modifications would need to flow through to the notes field on the TradeActivityLog

This is my understanding of how the modification to sc.ModifyOrder would impact on the process flow:
1) sc.OrderModifyOrder takes an s_SCNewOrder struct. Since 1 part of what I am trying to do is update the TextTag with the study values at the time of FILL (which is why I was trying to modify TextTag on s_SCTradeOrder). By the definition in the docs of sc.ModifyOrder, modification would cause it get sent to the trade service, which could result in a duplicate order (or fail, since the orderID would show as filled, and therefore that status of NewOrder? My goal is to be able to modify the TextTag when it gets filled:
a change in GetOrderFillArraySize triggers my code to call sc.GetOrderFillEntry querying and the FILLED order. I had previously attempted to modify the TextTag on s_SCTradeOrder, thinking that would flow through to the TradeActivityLog.

Re: 2nd part of what I (and i've seen others ask about this as well) would be capture of study values at EXIT. Looking over the structure of TradeActivityLog, I am not sure whether this could be implemented in a way that would be useful for the purpose of backtest analysis. Correct me if i am wrong. The data on the TRADES tab (which is what I export and analyze) turns entry & exit into 1 row (great!) but therefore only has 1 note. TradeACTIVITY separates entry & Exit and therefore could potentially have a different value for TextTag (because it is a distinct TradeObject), but then pulling that in and joining it to the whole position would require more data manipulation to pick up and relate than I suspect most people would want to (or be able to) deal with. The priority is the conditions present at the time of ENTRY, if I had to choose between them.

Hopefully that was clear (still on my 1st cup of coffee).
[2020-02-20 23:25:09]
jmt816 - Posts: 45
still awaiting response to my questions

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

Login

Login Page - Create Account