Multiple Strategies in one window

Questions about MultiCharts and user contributed studies.
User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 288 times

Multiple Strategies in one window

Postby MAtricks » 10 Feb 2015

If you have several strategies in one window (with Allow multiple entries when generated from a new order turned on), the back-test shows performance as each entry being independent which is correct, but any exit will exit your entire window's position. While looking further, a Profit Target or StopLoss written independently (using setstopcontract), will exit as each entry reaches it's PT or SL. This all looks great.

However, while running live, if one were to restart Multicharts or disconnect, a resync would show an averaged position among all the entries which would move the PT and SL.

Is there anyway around this? Since it back-tests in this way, shouldn't live trading work the same way?


*Remembering Strategy Positions* would be amazing..and necessary imo. Has there been any talk about a feature similar to this?

orion
Posts: 250
Joined: 01 Oct 2014
Has thanked: 65 times
Been thanked: 104 times

Re: Multiple Strategies in one window

Postby orion » 10 Feb 2015

This is an area where we need a bit of a workaround. I am using the PT but the concept would be applicable to chart window based trading as well. I call one signal the "trader" and the other signals are "strategists". A given symbol may have any number of strategists each trading different timeframes or strategies but there is only one trader for the symbol. The strategists for a symbol communicate their buy or sell recommendations to the trader via global variables. The trader consolidates the recommendations and places the orders. The trader also allocates positions among the strategists upon position updates. The trader also logs the positions to a file on disk so that on restart the positions among the strategists can be allocated correctly again.

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 288 times

Re: Multiple Strategies in one window

Postby MAtricks » 10 Feb 2015

Beautiful workaround... I'm impressed with your idea.


MC: you're not off the hook here :) I'd still like the points to be noted.

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 288 times

Re: Multiple Strategies in one window

Postby MAtricks » 12 Feb 2015

Henry,

Would you mind replying to my first post? I'd like to know why MC back-tests multiple strategies in a window correctly, but will not perform this way in live trading when a disconnection or a MC restart happens.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Multiple Strategies in one window

Postby Henry MultiСharts » 12 Feb 2015

Hello MAtricks,

I believe you already know the answer and Orion has provided good points.
MultiCharts does not store the position information across signals/instruments in order to restore it after restart of auto trading. There is no prebuilt way in MultiCharts to distribute the current average position for the instrument between individual charts/signals.

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 288 times

Re: Multiple Strategies in one window

Postby MAtricks » 12 Feb 2015

Henry :)

Thank you for the honest reply. You're right, I do know the answer. And you know my underlying question.. MC should remember positions. It seems essential in almost every circumstance.

-----------------------------
Now onto a short term fix:

Would using •Async and •Assume MP is the same as CHART create a situation where multiple strategies within one window be completely independent of each other which would allow a reconnection to MC where the strategies would execute as the back-test shows?

Edit:
I just tried this. Each strategy had its own PT and SL. Each position opened up as many PT and SL as I had strategies even though they weren't in a position. Any suggestions?

Image


Edit #2:
So I think I've gotten it. Apply all signals with AA and Same As Chart positions, but do not have any Profit Target or Stop Loss code within the strategies. Create a separate "money management" strategy. The downfall here is that all the strategies within this Window will have the same size PT and SL. Henry, please confirm these points?

CAUTION for readers: Do NOT use AA unless you understand it and have written your code to deal with the downfalls of this type of broker sync.
Attachments
AA testing.jpg
(350.16 KiB) Downloaded 939 times

orion
Posts: 250
Joined: 01 Oct 2014
Has thanked: 65 times
Been thanked: 104 times

Re: Multiple Strategies in one window

Postby orion » 13 Feb 2015

Henry,
I have a question in addition to what MAtricks is asking. I understand that marketPosition and marketPosition_at_broker_for_the_strategy always stay in sync in SA mode but they can get out of sync in AA mode. I also know that in SA mode, marketPosition_at_broker_for_strategy is updated on receiving order fill report from broker. Is this also true for AA mode? In other words, marketPosition_at_broker_for_the_strategy is updated if and only if a fill report is received in either AA or SA mode?
Thanks.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Multiple Strategies in one window

Postby Henry MultiСharts » 13 Feb 2015

MAtricks,

All signals applied to one chart form a single strategy with a single MarketPosition_at_Broker_for_The_Strategy (MC auto-trading engine position). If you have StopLoss and ProfitTarget in each signal - orders will be generated by each signal with the size = MarketPosition_at_Broker_for_The_Strategy. Additional information: How Scripts Work.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Multiple Strategies in one window

Postby Henry MultiСharts » 13 Feb 2015

marketPosition_at_broker_for_strategy is updated on receiving order fill report from broker. Is this also true for AA mode? In other words, marketPosition_at_broker_for_the_strategy is updated if and only if a fill report is received in either AA or SA mode?
Yes, it is also true for AA mode.


Return to “MultiCharts”