Trading one symbol with two strategies
Trading one symbol with two strategies
Hi.
I have a strategy I would like to apply twice to the same symbol (with different settings) and have it auto-trade.
My goal could be thought of as having a short-target strat and a long-target strat both active at once (but not necessarily entering at the same time).
I'm willing to put two strats on one chart, or two strats on two charts, or use the portfolio trader - whatever works reliably and cleanly.
Can anyone speak from experience about doing something like this?
What is a known good setup (and even what are known bad setups, if any) for accomplishing this?
Thanks!
I have a strategy I would like to apply twice to the same symbol (with different settings) and have it auto-trade.
My goal could be thought of as having a short-target strat and a long-target strat both active at once (but not necessarily entering at the same time).
I'm willing to put two strats on one chart, or two strats on two charts, or use the portfolio trader - whatever works reliably and cleanly.
Can anyone speak from experience about doing something like this?
What is a known good setup (and even what are known bad setups, if any) for accomplishing this?
Thanks!
- TJ
- Posts: 7744
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2224 times
Re: Trading one symbol with two strategies
No experiences to share...Hi.
I have a strategy I would like to apply twice to the same symbol (with different settings) and have it auto-trade.
My goal could be thought of as having a short-target strat and a long-target strat both active at once (but not necessarily entering at the same time).
I'm willing to put two strats on one chart, or two strats on two charts, or use the portfolio trader - whatever works reliably and cleanly.
Can anyone speak from experience about doing something like this?
What is a known good setup (and even what are known bad setups, if any) for accomplishing this?
Thanks!
Just asking to make sure you have got this covered,
Have you read the wiki doc on trading 2 strat on same symbol?
If you have, you should know what to expect and what needs to be done.
- TJ
- Posts: 7744
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2224 times
Re: Trading one symbol with two strategies
Trading from Multiple Charts on One InstrumentHi. I would expect that something has been written somewhere about this, but I'm having a difficult time turning it up either on the Forum or in the Wiki.
https://www.multicharts.com/trading-sof ... Instrument
Re: Trading one symbol with two strategies
Thanks TJ and MAtricks!
The information seems encouraging!
I did ask again here:
viewtopic.php?f=1&t=10204&p=111289#p111289
because it turns out Xyzzy has asked my exact question there, but the thread stopped without a reply to his last post.
The information seems encouraging!
I did ask again here:
viewtopic.php?f=1&t=10204&p=111289#p111289
because it turns out Xyzzy has asked my exact question there, but the thread stopped without a reply to his last post.
Re: Trading one symbol with two strategies
MC_Prog, I have not tried this but the following is my understanding.
MAtricks, since you have been doing this, can you please let us know whether following points are correct for two charts trading same symbol in SA mode:
1. marketPosition keyword in one chart will return the market position for that chart and will not see any market positions opened by strategy on other chart.
2. marketPosition keyword on chart will not be synchronized with marketPosition_at_broker since multiple charts are being used to trade.
3. market positions for either chart are not messed up by any market positions opened by manual trading. You may even have a manual trade that trades in opposite direction to strategy on chart and by so doing it makes the broker position flat but the chart position will stay as is.
4. setStopLoss and setProfitTarget brackets for an entry in one chart will not interfere with those from setStopLoss and setProfitTarget brackets for an entry on other chart. Both brackets will remain pending at broker. Furthermore, the brackets will remain pending even if you traded manually and made the broker position flat with manual trading.
MAtricks, since you have been doing this, can you please let us know whether following points are correct for two charts trading same symbol in SA mode:
1. marketPosition keyword in one chart will return the market position for that chart and will not see any market positions opened by strategy on other chart.
2. marketPosition keyword on chart will not be synchronized with marketPosition_at_broker since multiple charts are being used to trade.
3. market positions for either chart are not messed up by any market positions opened by manual trading. You may even have a manual trade that trades in opposite direction to strategy on chart and by so doing it makes the broker position flat but the chart position will stay as is.
4. setStopLoss and setProfitTarget brackets for an entry in one chart will not interfere with those from setStopLoss and setProfitTarget brackets for an entry on other chart. Both brackets will remain pending at broker. Furthermore, the brackets will remain pending even if you traded manually and made the broker position flat with manual trading.
Re: Trading one symbol with two strategies
I understand that there must be confusion here, but as I said there is nothing needed except separate charts. The charts are independent of each other. Market position and Profit targets are independent to the chart they're applied to.
Create a few charts and give it a go I have 20 strats on one symbol..
Create a few charts and give it a go I have 20 strats on one symbol..
Re: Trading one symbol with two strategies
TJ, thanks for bringing this up. I think this wiki entry is accurate but is a red herring by virtue of its sins of omission if the points I made in my previous post are correct. In addition to those points, I believe the following apply as well:Trading from Multiple Charts on One Instrument
https://www.multicharts.com/trading-sof ... Instrument
1. These strategy synchronizers will force the marketPosition keyword for the strategy to synchronize with the position returned by marketPosition_at_broker.
2. It is not necessary for marketPosition keyword in the chart to be synced with marketPosition_at_broker if your strategy code only references marketPosition. So you can trade multiple charts on the same symbol without using these synchronizers.
MAtricks, can you please advise on the truth value of the above statements since you have practical experience with this. Cheers.
Re: Trading one symbol with two strategies
Thanks. You answer addresses a lot of the source of potential confusion. Andrew or Henry can hopefully advise to the accuracy of the rest of the points in posts #7 and #9 above.I have no experience using the Marketposition_at_Broker so I cannot answer this. I see no need for this in my code.
Re: Trading one symbol with two strategies
My suggestion:
Create five 1 minute charts with different strategies on them. Apply them to a demo account. Click the SA button. And you will have the easy answer that I've been trying to relay
You're making it a lot harder than it is.
Create five 1 minute charts with different strategies on them. Apply them to a demo account. Click the SA button. And you will have the easy answer that I've been trying to relay
You're making it a lot harder than it is.
- Andrew MultiCharts
- Posts: 1587
- Joined: 11 Oct 2011
- Has thanked: 931 times
- Been thanked: 559 times
Re: Trading one symbol with two strategies
Hello everyone,
That is correct.1. marketPosition keyword in one chart will return the market position for that chart and will not see any market positions opened by strategy on other chart.
That is correct.2. marketPosition keyword on chart will not be synchronized with marketPosition_at_broker since multiple charts are being used to trade.
That is correct. Manual trading has its own market position, not accessible from a code. MarketPosition_at_broker will see the net positions, which may be formed by all strategy orders (sent from any chart) and manual orders (again sent from any chart). Please be careful with "...have a manual trade that trades in opposite direction to strategy on chart..."3. market positions for either chart are not messed up by any market positions opened by manual trading. You may even have a manual trade that trades in opposite direction to strategy on chart and by so doing it makes the broker position flat but the chart position will stay as is.
That is correct.4. setStopLoss and setProfitTarget brackets for an entry in one chart will not interfere with those from setStopLoss and setProfitTarget brackets for an entry on other chart. Both brackets will remain pending at broker. Furthermore, the brackets will remain pending even if you traded manually and made the broker position flat with manual trading.
Re: Trading one symbol with two strategies
I'm lovin' what I'm reading above, both the "it just works" aspect, and the detailed Q&A. Many thanks!
Hopefully I will be able to add my own experiences here in the not-too-distance future.
Hopefully I will be able to add my own experiences here in the not-too-distance future.
Re: Trading one symbol with two strategies
OK, did my first run this AM. Used same strat, different settings, on two charts with the same symbol. Broker was IB, via standalone TWS running on the same machine as MC 9.0.
The entries and exits did all take place where they were supposed to. (Nice!)
However, the displays during the life of the trade were quite confusing to me.
With Chart Trading set on each chart to 'Show Open Positions' and 'Show Active Orders' what I got was each chart showing ALL entry and exit lines.
What I would have liked to see is each chart showing only the entry/exit lines for the strategy running on that chart.
Is that possible at this point in time?
If not, would it perhaps be possible as a future enhancement (or would that be contrary to design principles MC has decided to settle on)?
P.S. Probably the current behavior is exactly what some people would prefer, but I think having each chart just show it's own situation (rather than a global situation) is something that many others would agree is desirable, as an option, for those who wish it.
The entries and exits did all take place where they were supposed to. (Nice!)
However, the displays during the life of the trade were quite confusing to me.
With Chart Trading set on each chart to 'Show Open Positions' and 'Show Active Orders' what I got was each chart showing ALL entry and exit lines.
What I would have liked to see is each chart showing only the entry/exit lines for the strategy running on that chart.
Is that possible at this point in time?
If not, would it perhaps be possible as a future enhancement (or would that be contrary to design principles MC has decided to settle on)?
P.S. Probably the current behavior is exactly what some people would prefer, but I think having each chart just show it's own situation (rather than a global situation) is something that many others would agree is desirable, as an option, for those who wish it.
Re: Trading one symbol with two strategies
A separate issue is that as soon as the 2nd chart puts on a trade (while the first chart still has a trade open), the reference line for position entry (and current open P&L) becomes the average price for the two positions.
Again, some might like this, but I find it very confusing.
Is it possible at the current time to configure so that each chart tracks, displays, and references it's own entry price?
If not, would it perhaps be possible as a future enhancement (or would that be contrary to design principles MC has decided to settle on)?
Again, some might like this, but I find it very confusing.
Is it possible at the current time to configure so that each chart tracks, displays, and references it's own entry price?
If not, would it perhaps be possible as a future enhancement (or would that be contrary to design principles MC has decided to settle on)?
- Andrew MultiCharts
- Posts: 1587
- Joined: 11 Oct 2011
- Has thanked: 931 times
- Been thanked: 559 times
Re: Trading one symbol with two strategies
Unfortunately it is not possible at the moment, it shows all positions and all orders (assuming the market and the broker account is the same).With Chart Trading set on each chart to 'Show Open Positions' and 'Show Active Orders' what I got was each chart showing ALL entry and exit lines.
What I would have liked to see is each chart showing only the entry/exit lines for the strategy running on that chart.
Is that possible at this point in time?
Please leave us such feature request.If not, would it perhaps be possible as a future enhancement (or would that be contrary to design principles MC has decided to settle on)?
P.S. Probably the current behavior is exactly what some people would prefer, but I think having each chart just show it's own situation (rather than a global situation) is something that many others would agree is desirable, as an option, for those who wish it.
Re: Trading one symbol with two strategies
I have not been able to do the experiment since all my licenses are in use. Thanks for posting your results and thanks to Andrew for responding.A separate issue is that as soon as the 2nd chart puts on a trade (while the first chart still has a trade open), the reference line for position entry (and current open P&L) becomes the average price for the two positions. Again, some might like this, but I find it very confusing.
Is it possible at the current time to configure so that each chart tracks, displays, and references it's own entry price?
MC_Prog, are you saying that if chart A strategy code makes an entry at 50 and then later chart B strategy code makes an entry at 60 then the EntryPrice keyword in both will return 55 instead of their individual values? I believe following should be valid though I have not done this experiment yet.
1. All Strategy Performance keywords and all Strategy Position keywords (keywords such as EntryPrice, BarsSinceEntry, CurrentShares, PositionProfit, OpenPositionProfit, ...) return the values for the respective chart strategies. It would not make sense for them to reflect the values from the other strategy. Correct?
2. The only keywords in these two categories that should reflect the aggregate state should be MarketPosition_at_Broker and AvgEntryPrice_at_Broker. Keywords from the Accounts and Positions category should also reflect the global sate. Correct?
Links to these keyword groups:
http://www.multicharts.com/trading-soft ... erformance
http://www.multicharts.com/trading-soft ... y_Position
http://www.multicharts.com/trading-soft ... _Positions
Re: Trading one symbol with two strategies
Here I am referring to the line and price value displayed on the chart which is intended to show the level of entry and the open P&L.A separate issue is that as soon as the 2nd chart puts on a trade (while the first chart still has a trade open), the reference line for position entry (and current open P&L) becomes the average price for the two positions.
This is the line enabled/disabled from the Format Chart Trading dialog by checking/unchecking 'Show Open Positions'.
AFAIK, Orion, your #1 and #2 above are correct.
Last edited by MC_Prog on 10 Dec 2014, edited 1 time in total.
Re: Trading one symbol with two strategies
I like where you're going with this. I've wished for quite some time that each window would be completely independent of the others. I'd like to access the average market position, but not have it as the only available feature. If a strategy has resting orders or a position, only its window should show these.
Where I see MC needing work is the Order and Position Tracker. When you have multiple positions in one symbol, its performance is quite odd. I don't think these features were ever tested in an environment like what we're doing.
Honestly though, once you get used to it, you'll be fine with it. Regardless of the averaged market position, your windows strategy position is independent and doesn't use this unless its meant to.
Try this: Format Chart Trading -> Connecting Line tab -> Uncheck Show Connecting Line. Doing this will give you lines from trades generated from that window only. This helps with confusion.
Since I run so many strategies on each symbol, I turn off all features of a chart. No orders or trades show at all. These 'trade windows' are very small. I have one window for each symbol which is a bit larger than the rest which shows the orders, positions, and trade lines for all strategies.
I have a decent amount of experience with this stuff so if there are any specific questions, I'd be glad to help out where I can. AFTER I have a coffee! I was up all night working and my guess is that none of this made much sense haha
Where I see MC needing work is the Order and Position Tracker. When you have multiple positions in one symbol, its performance is quite odd. I don't think these features were ever tested in an environment like what we're doing.
Honestly though, once you get used to it, you'll be fine with it. Regardless of the averaged market position, your windows strategy position is independent and doesn't use this unless its meant to.
Try this: Format Chart Trading -> Connecting Line tab -> Uncheck Show Connecting Line. Doing this will give you lines from trades generated from that window only. This helps with confusion.
Since I run so many strategies on each symbol, I turn off all features of a chart. No orders or trades show at all. These 'trade windows' are very small. I have one window for each symbol which is a bit larger than the rest which shows the orders, positions, and trade lines for all strategies.
I have a decent amount of experience with this stuff so if there are any specific questions, I'd be glad to help out where I can. AFTER I have a coffee! I was up all night working and my guess is that none of this made much sense haha
Re: Trading one symbol with two strategies
Yes, that would be my preference also.I've wished for quite some time that each window would be completely independent of the others. I'd like to access the average market position, but not have it as the only available feature. If a strategy has resting orders or a position, only its window should show these.
Last edited by MC_Prog on 10 Dec 2014, edited 1 time in total.
Re: Trading one symbol with two strategies
Indeed, was set up that way. When all was done the connecting lines were as desired/expected.Try this: Format Chart Trading -> Connecting Line tab -> Uncheck Show Connecting Line. Doing this will give you lines from trades generated from that window only. This helps with confusion.
- Andrew MultiCharts
- Posts: 1587
- Joined: 11 Oct 2011
- Has thanked: 931 times
- Been thanked: 559 times
Re: Trading one symbol with two strategies
1. All Strategy Performance keywords and all Strategy Position keywords (keywords such as EntryPrice, BarsSinceEntry, CurrentShares, PositionProfit, OpenPositionProfit, ...) return the values for the respective chart strategies. It would not make sense for them to reflect the values from the other strategy. Correct?
2. The only keywords in these two categories that should reflect the aggregate state should be MarketPosition_at_Broker and AvgEntryPrice_at_Broker. Keywords from the Accounts and Positions category should also reflect the global sate. Correct?
Links to these keyword groups:
http://www.multicharts.com/trading-soft ... erformance
http://www.multicharts.com/trading-soft ... y_Position
http://www.multicharts.com/trading-soft ... _Positions
- Yes, such keywords return values from the specific chart, where they are applied only.
- "at_Broker" keywords get their values from (surprise!) broker, not from chart.
Re: Trading one symbol with two strategies
Just to mention, my own single-symbol multi-chart trading continues with all entry and exit orders working well as per advice above.
The displays are not "this chart's strategy only" as I would prefer (and I will write a feature request for that sometime soon), but the actual trading is doing what's needed and expected.
Bravo MC!
The displays are not "this chart's strategy only" as I would prefer (and I will write a feature request for that sometime soon), but the actual trading is doing what's needed and expected.
Bravo MC!
Re: Trading one symbol with two strategies
MATricks, thanks for your info on this - could you just explain if your trading 20 strats on same symbol and same account - say your long 10 and short 10 (if you had the actual entries showing) they would each show their respective entries and exits (you would have all 20 entries and exits on each chart unless as you do choose not to show them) but in fact your net position as reported by Order & Position Tracker would be zero?I like where you're going with this. I've wished for quite some time that each window would be completely independent of the others. I'd like to access the average market position, but not have it as the only available feature. If a strategy has resting orders or a position, only its window should show these.
In addition, how would that alter if in AA mode rather than SA mode (if at all).
Thanks
Michael
Re: Trading one symbol with two strategies
If you have 10 strats that are long and 10 that are short, your broker position is flat. This is exactly as simple as it sounds. While running multiple strats on one symbol, remember not to pay attention to the Open Positions tab in the Order and Position tracker, but to pay attention to the Strategy Positions tab.
Each independent strategy will have its independent exit which will create the expected broker position change.
SA gives me a warm and fuzzy feeling because its calculated from the broker position . Picking SA over AA is entirely personal preference. This choice will not affect what we're talking about.
Each independent strategy will have its independent exit which will create the expected broker position change.
SA gives me a warm and fuzzy feeling because its calculated from the broker position . Picking SA over AA is entirely personal preference. This choice will not affect what we're talking about.
- Andrew MultiCharts
- Posts: 1587
- Joined: 11 Oct 2011
- Has thanked: 931 times
- Been thanked: 559 times
Re: Trading one symbol with two strategies
MATricks, thanks for your info on this - could you just explain if your trading 20 strats on same symbol and same account - say your long 10 and short 10 (if you had the actual entries showing) they would each show their respective entries and exits (you would have all 20 entries and exits on each chart unless as you do choose not to show them) but in fact your net position as reported by Order & Position Tracker would be zero?
You got "A" for "Auto-trading" subject.If you have 10 strats that are long and 10 that are short, your broker position is flat. This is exactly as simple as it sounds. While running multiple strats on one symbol, remember not to pay attention to the Open Positions tab in the Order and Position tracker, but to pay attention to the Strategy Positions tab.
Each independent strategy will have its independent exit which will create the expected broker position change.
In addition, how would that alter if in AA mode rather than SA mode (if at all).
Ok, it is "A-" now. In SA it is supposed to start in sync with broker position, if so then it will be in sync, however in fact there is no actual forced synchronization. The only 2 things that should be taken into account is that you will see "False" in position match in Order and Position Tracker (doesn't really affect anything) and that you should be careful with using "_at_broker" keywords.SA gives me a warm and fuzzy feeling because its calculated from the broker position .
That is true. Any of the modes can be used if we are talking about auto-trading from multiple charts (same market, same account).Picking SA over AA is entirely personal preference. This choice will not affect what we're talking about.
Re: Trading one symbol with two strategies
Andrew, using two strategies S1 and S2 to trade same symbol in PT is a bit different than using charts since the 'Show the assign the initial market position' dialog is not available.
I want to check on how to make this work for PT assuming strategies are not flat at end of trading session and the PT is restarted when new session begins. My thinking is to use the automatic sync option 'Use the actual position at the broker'. Lets say the actual position at broker was +3 at end of last session but respective strategy positions were +5 and -2. Questions:
1) What is expected behavior with S1 and S2 market positions on restart when you do 'Use the actual position at the broker'? Do they both get marketPosition = 1 and currentContracts = 3?
2) I am thinking of using changeMarketPosition keyword in S1 and S2 to bring them in line with what they actually were at end of last session. I am assuming this will work and it will not place any actual orders with the broker?
3) Will changeMarketPosition change both marketPosition and currentContracts?
4) If using SA mode, does changeMarketPosition also change marketPosition_at_broker_for_the_strategy?
Thanks.
I want to check on how to make this work for PT assuming strategies are not flat at end of trading session and the PT is restarted when new session begins. My thinking is to use the automatic sync option 'Use the actual position at the broker'. Lets say the actual position at broker was +3 at end of last session but respective strategy positions were +5 and -2. Questions:
1) What is expected behavior with S1 and S2 market positions on restart when you do 'Use the actual position at the broker'? Do they both get marketPosition = 1 and currentContracts = 3?
2) I am thinking of using changeMarketPosition keyword in S1 and S2 to bring them in line with what they actually were at end of last session. I am assuming this will work and it will not place any actual orders with the broker?
3) Will changeMarketPosition change both marketPosition and currentContracts?
4) If using SA mode, does changeMarketPosition also change marketPosition_at_broker_for_the_strategy?
Thanks.
Re: Trading one symbol with two strategies
I have posted a feature request:
MC-1816 - Independence of Charts wrt. Order and Position Display
https://www.multicharts.com/pm/viewissu ... no=MC-1816
MC-1816 - Independence of Charts wrt. Order and Position Display
https://www.multicharts.com/pm/viewissu ... no=MC-1816
- Andrew MultiCharts
- Posts: 1587
- Joined: 11 Oct 2011
- Has thanked: 931 times
- Been thanked: 559 times
Re: Trading one symbol with two strategies
In both modes, the strategy positions will be +3 if 'Use the actual position at the broker' is selected.I want to check on how to make this work for PT assuming strategies are not flat at end of trading session and the PT is restarted when new session begins. My thinking is to use the automatic sync option 'Use the actual position at the broker'. Lets say the actual position at broker was +3 at end of last session but respective strategy positions were +5 and -2. Questions:
1) What is expected behavior with S1 and S2 market positions on restart when you do 'Use the actual position at the broker'? Do they both get marketPosition = 1 and currentContracts = 3?
Yes, i believe it will work as a workaround for your case.2) I am thinking of using changeMarketPosition keyword in S1 and S2 to bring them in line with what they actually were at end of last session. I am assuming this will work and it will not place any actual orders with the broker?
In AA mode: it will work only for MarketPosition_at_broker_for_the_Strategy.3) Will changeMarketPosition change both marketPosition and currentContracts?
In SA mode: yes, both for MarketPosition and CurrentContracts (and MarketPosition_at_Broker_for_the_Strategy).
Yes. In fact it changes exactly the MarketPosition_at_Broker and other keywords are synced with it.4) If using SA mode, does change MarketPosition also change marketPosition_at_broker_for_the_strategy?
Re: Trading one symbol with two strategies
Sorry for resurrecting this somewhat old thread but I want to do something similar but do it in a different way.
Is it possible to have multiple strategies on one instrument but have them in the same chart *AND* use different, specific profit targets and stops for each strategy running? I know that setprofittarget is a global command for all strategies in the chart, but is there a way to make it specific? Perhaps by mentioning the name of the buy/short order?
Thanks in advance for your help.
Is it possible to have multiple strategies on one instrument but have them in the same chart *AND* use different, specific profit targets and stops for each strategy running? I know that setprofittarget is a global command for all strategies in the chart, but is there a way to make it specific? Perhaps by mentioning the name of the buy/short order?
Thanks in advance for your help.
Re: Trading one symbol with two strategies
No, you can't do that.
On a related point but different point, note that in MC parlance, a strategy is a chart (aka symbol) and the signals applied to the chart. It is common to confuse the terms signal and strategy. When two or more signals are applied to a chart, they interact and make up a single strategy.
On a related point but different point, note that in MC parlance, a strategy is a chart (aka symbol) and the signals applied to the chart. It is common to confuse the terms signal and strategy. When two or more signals are applied to a chart, they interact and make up a single strategy.