OpenEntry keywords and Sync Auto Trading

Questions about MultiCharts and user contributed studies.
MechTrader
Posts: 15
Joined: 29 Feb 2008

OpenEntry keywords and Sync Auto Trading

Postby MechTrader » 17 Jul 2020

When running in Synchronous (sync) Auto Trading Mode (for instance, with Interactive Brokers), will the sub-positions at the broker be known to the strategy upon startup? In other words, when I restart the strategy and it first starts up, will the variable OpenEntryPrice(n) have the price for each entry into the current position or are all the entries flattened into a single entry equivalent to the average position at the broker? This same question applies to all OpenEntry{...} variables and any other that read the individual entries that make up a net position.

The ability to read this sub-position information is important for any strategy that treats the entries individually rather than as a net position, such as those that exit each entry at different prices. So it would be good if that information were available. If MC cannot read this information (unlike MT and many other platforms) it makes automation more difficult and workarounds are needed.

If the info is not available, the best workaround I can think of is to run the strategy in Async mode from a fixed starting date and use !From Strategy to Broker MP Synchronizer! with long time settings to synchronize the broker position at startup using the backtested positions for info on the individual entries, OR perhaps to use sync mode and synchronize the strategy at startup from a file using the ChangeMarketPosition keyword.

Any other ideas on the best approach?

MechTrader
Posts: 15
Joined: 29 Feb 2008

Re: OpenEntry keywords and Sync Auto Trading

Postby MechTrader » 17 Jul 2020

Answered my own question on how the entries are treated.

I created a test to check this and was able to get the answer: I entered long into a stock 3 times at different prices, then read the OpenEntryPrice(n) for n from 0 to OpenEntryCount-1. The data is collapsed to a single average entry. That is, the strategy sees the broker's average position as a single entry, not as the individual entries that comprise the average.


Return to “MultiCharts”