If a trade totally executes within a single bar, i.e. enters and exits in the same bar, NONE of the normal trade information commands are updated. MarketPosition, entry/exit times/dates, etc. don't receive information about the trade.
I contacted MC support about this issue and was told it was not a bug it was "expected behavior" whatever that means. They suggested using TotalTrades command, which is useless, does not give any info about the trade, just that a trade happened. I need realtime trade time info, at the least. Multiple bar trades work just fine, this bug is restricted to single bar trades.
This bug is easy to duplicate on a 1 minute chart. Unfortunately, I use Interactive Brokers for my data source, so I can't create tick charts to examine this more closely.
Any ideas? Any way to get MC to fix this?
Thanks,
Lew Lepley, a happy but perplexed MC programmer...
Single bar trade execution [SOLVED]
Re: MC single bar trade execution
I trade on 5 minute bars, often opening and closing a position on the same bar and I don't have any problems. And I also use total trades as back up logic to prevent more than one trade per bar and or limit total trades per day. Perhaps there is something wrong in your script?
Re: MC single bar trade execution [SOLVED]
Perhaps this only happens on 1 minute bars.
I don't think it's a script error, as MC admitted knowing of the issue. They just said it was an "expected behavior". I never got an explanation of what "expected behavior" means. Sounds like "Undocumented Design Feature", (UDF) old programmers joke for a bug they don't want to admit...
I DID find a workaround, suggested by their support staff, using the TotalTrades command.
i.e. Totaltrades <> Totaltrades[1] and then executing other commands to check on the trade from there using the (1) options, i.e. exittime(1) instead of exittime.
Works for now. Thanks for the feedback.
I don't think it's a script error, as MC admitted knowing of the issue. They just said it was an "expected behavior". I never got an explanation of what "expected behavior" means. Sounds like "Undocumented Design Feature", (UDF) old programmers joke for a bug they don't want to admit...
I DID find a workaround, suggested by their support staff, using the TotalTrades command.
i.e. Totaltrades <> Totaltrades[1] and then executing other commands to check on the trade from there using the (1) options, i.e. exittime(1) instead of exittime.
Works for now. Thanks for the feedback.
- TJ
- Posts: 7745
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2224 times
Re: MC single bar trade execution
MarketPosition, etc., are calculated at the EOB. They might give false readings if you want intrabar details.