Single bar trade execution  [SOLVED]

Questions about MultiCharts and user contributed studies.
interfool
Posts: 7
Joined: 14 Nov 2013

Single bar trade execution

Postby interfool » 08 Apr 2016

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

tony
Posts: 420
Joined: 14 Jun 2013
Has thanked: 30 times
Been thanked: 81 times
Contact:

Re: MC single bar trade execution

Postby tony » 08 Apr 2016

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?

interfool
Posts: 7
Joined: 14 Nov 2013

Re: MC single bar trade execution  [SOLVED]

Postby interfool » 09 Apr 2016

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.

User avatar
TJ
Posts: 7743
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: MC single bar trade execution

Postby TJ » 09 Apr 2016

MarketPosition, etc., are calculated at the EOB. They might give false readings if you want intrabar details.


Return to “MultiCharts”