Trading same symbol from multiple charts  [SOLVED]

Questions about MultiCharts and user contributed studies.
Xyzzy
Posts: 162
Joined: 19 Mar 2011
Has thanked: 43 times
Been thanked: 79 times

Trading same symbol from multiple charts

Postby Xyzzy » 30 Mar 2012

I'm hoping to implement an auto-trade strategy that would be applied to the same symbol on two different charts. I'm trying to sort out the best approach between synchronous and asynchronous mode for this situation. I've reviewed these wiki pages:

https://www.multicharts.com/trading-sof ... _Execution

https://www.multicharts.com/trading-sof ... Instrument

Each chart would execute the same strategy, but would do so at different times of the day and with different inputs. Any orders would be placed in the same direction, based on the long-term market trend. I.e., they might both go long, or both go short. However, they won't go in opposite directions on the same day (one long, one short). Also, since they trade at different times of the day, it wouldn't be possible for each chart to generate an entry order simultaneously, on the same bar.

Under these circumstances, could I use the synchronous trading strategy on both charts? E.g., assume that one chart places a buy limit order at 10:00 AM, that the second chart places a buy limit order at 11:00 AM, and that both orders are filed. If both positions remain open, then my total position at the broker should now be two contracts long, and there should be a corresponding OCA profit target/stop loss order for each contract.

Would the synchronous mode work correctly in these circumstances, showing an open position of one contract on each chart? Also, would MultiCharts transmit the correct profit target/stop loss orders to the broker, one for each chart? (Note that the exit prices for each contract will likely be different, assuming that the entry prices were different.)

Alternatively, would these strategies work correctly if I use async mode, but without using the "convert to market order" option? In particular, what would happen if one strategy places a buy limit order, but that order isn't filled, so my position still remains flat at the broker? Would MultiCharts still transmit the exit orders (profit target/stop loss) to the broker, and is there a risk that the broker (IB) would still fill those orders as sell limit/sell stop orders? (If that's the case, then I could end up incorrectly in a short position.) Or would the broker be smart enough to reject or cancel the exit orders, since the entry order wasn't filled?

Thanks in advance for any help.

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: Trading same symbol from multiple charts

Postby Andrew MultiCharts » 03 Apr 2012

I'm hoping to implement an auto-trade strategy that would be applied to the same symbol on two different charts. I'm trying to sort out the best approach between synchronous and asynchronous mode for this situation. I've reviewed these wiki pages:

https://www.multicharts.com/trading-sof ... _Execution

https://www.multicharts.com/trading-sof ... Instrument

Each chart would execute the same strategy, but would do so at different times of the day and with different inputs. Any orders would be placed in the same direction, based on the long-term market trend. I.e., they might both go long, or both go short. However, they won't go in opposite directions on the same day (one long, one short). Also, since they trade at different times of the day, it wouldn't be possible for each chart to generate an entry order simultaneously, on the same bar.

Under these circumstances, could I use the synchronous trading strategy on both charts? E.g., assume that one chart places a buy limit order at 10:00 AM, that the second chart places a buy limit order at 11:00 AM, and that both orders are filed. If both positions remain open, then my total position at the broker should now be two contracts long, and there should be a corresponding OCA profit target/stop loss order for each contract.
It seems to me that some of our customers are confused with the names of the modes of auto trading.

Synchronous mode [SA] means that on chart you will see the same position and orders as at broker (IMPORTANT: if only 1 chart is auto trading with no manual orders on a particular symbol connected a particular broker account, assuming that at the moment the automation was turned on the broker position was flat).

Asynchronous mode [AA] means that the chart will continue trading based on the historically generated in the process of backtesting orders and open position, showing all generated by the scrips orders on chart even if the order were not executed for whatever reason. In AA strategy on chart acts separately from broker.

Answering your question: yes, you can use SA mode on each chart (technically as well as AA, but SA is much better in this case, see below why exactly), but since each chart with strategy is a separate trading system, when, let's say, the first chart stops auto trading by afternoon with position +3 (long), even if you turn on auto execution on the second chart to continue trading on the same symbol, you will need to tell the strategy what is the current position at broker, using Show the Assign the Initital Market Position at the Broker Dialogue -> Show Always in Strategy Properties on Auto Trading tab. In this sense "Synchronous" doesn't mean it will figure out your broker position on start itself to be always in synch.
Would the synchronous mode work correctly in these circumstances, showing an open position of one contract on each chart?
I believe it is described above. By the way, if you open the Chart Trading Panel on each of your charts, you will find active orders, open positions, PnL on each chart, but only visually. Each next chart will not bring up that all automatically to continue auto trading using those inputs.
Also, would MultiCharts transmit the correct profit target/stop loss orders to the broker, one for each chart? (Note that the exit prices for each contract will likely be different, assuming that the entry prices were different.)
Active, not yet executed orders that stay at broker are not existing for next chart when you turn on automation there (so the strategy may send the same PF and SL orders, ignoring the set from previous chart ones). My recomendation here is to turn off auto trading manually on the previous chart, cancelling all active orders at broker. If the conditions fr PF ad SL are identical on both previous and next charts and they are met, when the last one starts auto execution it should send new identical TP and SL orders.

Alternatively, would these strategies work correctly if I use async mode, but without using the "convert to market order" option?
In [AA] it can possibly lead to increasing with each new chart mismatches. Strongly do not recommend [AA].
In particular, what would happen if one strategy places a buy limit order, but that order isn't filled, so my position still remains flat at the broker? Would MultiCharts still transmit the exit orders (profit target/stop loss) to the broker, and is there a risk that the broker (IB) would still fill those orders as sell limit/sell stop orders? (If that's the case, then I could end up incorrectly in a short position.)
In [SA]: if an order is not filled/rejected/cancelled at broker, then it won't be displayed on the chart and the positions on chart and at broker will match.
In [AA]: if an order is not filled/rejected/cancelled at broker, then it will be displayed on the chart as executed one and the positions on chart and at broker will no longer match.
Or would the broker be smart enough to reject or cancel the exit orders, since the entry order wasn't filled?
A broker simply receives commands to buy or sell. It will (well, it is supposed to, at least) execute all that is sent from MC and is not cancelled/rejected.
Thanks in advance for any help.
You are welcome. :-)
P.S. If each chart auto trades in [SA] and the From Broker To Startegy Synchronizer is used with correct inputs to change chart position quickly (not the same moment, though) to the same as broker position right after the start, then they will be in synch, when you turn on automation on each of them. The synchronizer should emulate the same position on chart for the strategy. However this workaround has not been ever tested, because Synchronizers themselves were designed for different purposes. I still recommend to assign the initial market position on start manually without any synchronizers, when a new chart starts auto trading.

Xyzzy
Posts: 162
Joined: 19 Mar 2011
Has thanked: 43 times
Been thanked: 79 times

Re: Trading same symbol from multiple charts

Postby Xyzzy » 04 Apr 2012

Answering your question: yes, you can use SA mode on each chart (technically as well as AA, but SA is much better in this case, see below why exactly), but since each chart with strategy is a separate trading system, when, let's say, the first chart stops auto trading by afternoon with position +3 (long), even if you turn on auto execution on the second chart to continue trading on the same symbol, you will need to tell the strategy what is the current position at broker, using Show the Assign the Initital Market Position at the Broker Dialogue -> Show Always in Strategy Properties on Auto Trading tab. In this sense "Synchronous" doesn't mean it will figure out your broker position on start itself to be always in synch.
Thanks very much for the detailed response, Andrew. Unfortunately, turning one chart off manually when the second strategy begins isn't an option for my situation.

To be more specific, the strategy is a gap-open strategy that executes once at 5:31 AM Pacific time, and once again at 6:31 AM Pacific time. I set the charts to "auto" each evening, and let them execute automatically at the specified times. When I turn on the signals in the evening, both positions will be flat.

Once each order executes, it will also place a bracket order for a sell limit (profit target) and sell stop (stop loss). These orders remain open until one is filled, or until the end of day (with a market exit).

There's a possibility that the 5:31 order will execute a buy order, but the strategy won't hit either the profit target or stop loss quickly, so that position will remain open. If the 6:31 strategy places a second buy order, then I'll want to keep both positions open -- with separate profit target and stop-loss exits for each. My strategy wouldn't work well if I needed to close the 5:31 order before the 6:31 order opens.

From what I'm hearing, perhaps using SA mode on two charts isn't the best option. My fallback position is to rewrite the strategy so that the same signal places both entry orders from the same chart -- once at 5:31 AM, and once again at 6:31 AM. This is doable, but it would make the code more complicated. However, if that's the safer option, I'll do that instead.

On the other hand, if the SA mode on two charts would work in this situation, please let me know -- it would be the easier method for me to handle this.

User avatar
MC_Prog
Posts: 330
Joined: 28 Feb 2007
Has thanked: 64 times
Been thanked: 35 times

Re: Trading same symbol from multiple charts

Postby MC_Prog » 09 Dec 2014

Hi.

The information here is good, but even so, I am not 100% clear on what would happen under the scenario Xyzzy has asked about in his last, unanswered post.

I have exactly the same question about exactly the same situation (even though it is not a gap strat in my case).

If MC staff (or perhaps by now Xyzzy h'self) could possibly comment further to make clear that two strategies, on two charts, on the same symbol, both started while flat and running simultaneously will keep themselves straight (or not), I'd appreciate it.

Thanks!

User avatar
MC_Prog
Posts: 330
Joined: 28 Feb 2007
Has thanked: 64 times
Been thanked: 35 times

Re: Trading same symbol from multiple charts

Postby MC_Prog » 09 Dec 2014

BTW, in my thinking about this so far, I don't see that either

!From Broker To Strategy MP Synchronizer!

or

!From Strategy To Broker MP Synchronizer!

are going to be needed for this scenario.

Is that correct?

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: Trading same symbol from multiple charts  [SOLVED]

Postby Andrew MultiCharts » 10 Dec 2014

Hello MC_Prog,
If MC staff (or perhaps by now Xyzzy h'self) could possibly comment further to make clear that two strategies, on two charts, on the same symbol, both started while flat and running simultaneously will keep themselves straight (or not), I'd appreciate it.
BTW, in my thinking about this so far, I don't see that either

!From Broker To Strategy MP Synchronizer!

or

!From Strategy To Broker MP Synchronizer!

are going to be needed for this scenario.

Is that correct?
If there are two charts auto-trading, they work individually, they don't interact by default. If you want them to interact, you will need to use the !From Broker To Strategy MP Synchronizer!.

If you want each of the strategy to calculate individually as if it is the only auto-trading strategy in the software, you can simply enable automation on 2 charts and let them calculate.

User avatar
MC_Prog
Posts: 330
Joined: 28 Feb 2007
Has thanked: 64 times
Been thanked: 35 times

Re: Trading same symbol from multiple charts

Postby MC_Prog » 10 Dec 2014

Very good. Thank you Andrew!


Return to “MultiCharts”