Login Page - Create Account

Support Board


Date/Time: Sun, 19 May 2024 04:55:51 +0000



Post From: TextTag and backtesting

[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).