The opinions expressed in these forums do not represent those of C2, and any discussion of profit/loss
is not indicative of future performance or success.
There is a substantial risk of loss in trading. You should therefore carefully consider
whether such trading is suitable for you in light of your financial condition. You should read,
understand, and consider the Risk Disclosure Statement that is provided by your broker
before you consider trading. Most people who trade lose money.
For entry I get:
102705169 85617966 102705172 2016-06-06T14:03:07
2016-06-06T14:03:07 BTO 900 BAX 1 0 0 0 stock 0 43.770057
For exit I get
104216503 85617966 102705172 2016-06-22T12:24:37 2016-06-22T12:24:38 STC 2000 BAX 1 0 0 1 stock 0 44.859
Nothing really lines up. Not the quantities, among trade and exit and entry signals, not the prices.
This is not an individual data bug, I run into it all over the place when I try to do a join between the trades table and the signal table. It just doesn’t work properly.
I assume (??) that the data you use internally is accurate, but the exported database schema is not very useful. [I **suspect** --but this only speculation on my part-- that internally you do some type of grouping and aggregating but this is not captured in the exported schema.]
The data snippets in my original question were not very well formatted (apologies!). My question was not about the potential discrepancy in trade results with or without commission.
It was about the structure of the TRADES and the SIGNALS tables.
The TRADES table has a field, CloseSignalId and it is documented as “ID of the closing signal.” This, as I pointed out in my original is a little misleading as the FK-ed SIGNAL entry is only one of the signals contributing to this trade.
In my code using this ID I tried to JOIN the TRADES and the SIGNALS table but I got incorrect result. This is what I hoped to show in my original post, when I said that “Nothing really lines up. Not the quantities, among trade and exit and entry signals, not the prices.” I understand now that in order to get correct result I need to do a GROUP JOIN. (And I don’t understand the role of the Open/Close SignalId in the TRADES table, but I don’t need to understand it for what I am doing.)
Thanks again,
Joseph
[Just an aside: this took me a while to discover; you may want to rewrite the documentation slightly, like “ID of one of the closing signals.” Just a suggestion.]
OpenSignalId is the first signal. It opens a trade.
CloseSignalId is the last signal which makes a position flat.
Let’s stay with Mozart and investigate the trade #102705172:
TABLE = from trade in C2TRADES
where trade.Id == 102705172
select trade;
TABLE = from signal in C2SIGNALS
where signal.TradeId == 102705172
select signal;