Auto trading one symbol, multiple charts  [SOLVED]

Questions about MultiCharts and user contributed studies.
AAY
Posts: 56
Joined: 29 Nov 2013
Has thanked: 9 times
Been thanked: 30 times

Auto trading one symbol, multiple charts

Postby AAY » 03 Dec 2013

Hello

I read this topic viewtopic.php?f=1&t=10204&start=0

but it's still not clear to me how the whole thing works.

I want to trade one symbol on multiple charts. Strategies are similar, with slightly different parameters. They will produce similar orders at about the same time. What mode should I choose, SA or AA?

When using AA, if limit entry order is not filled, will strategy produce an exit order and send it to broker?

Can I use SA, disregard visual chart-broker position discrepancies on each chart and assume that all entry orders that are filled will be closed correctly?

Thanks.

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

Re: Auto trading one symbol, multiple charts

Postby Andrew MultiCharts » 03 Dec 2013

Hello AAY,
I want to trade one symbol on multiple charts. Strategies are similar, with slightly different parameters. They will produce similar orders at about the same time. What mode should I choose, SA or AA?
It is up for you to decide. I always recommend SA.
When using AA, if limit entry order is not filled, will strategy produce an exit order and send it to broker?
Strategy logic is not affected by switching the modes. It will work the way it is written. The difference in modes = different starting points of calculation + different visual results on chart.
Can I use SA, disregard visual chart-broker position discrepancies on each chart and assume that all entry orders that are filled will be closed correctly?
If you write your code correctly (using MarketPosition_at_Broker and MarketPosition_at_Broker_for_The_Strategy keywords), it will still be able to place orders according to actual position at broker, but in this case the strategy on chart will behave still individually, because chart position in auto-trading engine will be affected only by the orders generated from this exact chart.

AAY
Posts: 56
Joined: 29 Nov 2013
Has thanked: 9 times
Been thanked: 30 times

Re: Auto trading one symbol, multiple charts

Postby AAY » 03 Dec 2013

When using AA, if limit entry order is not filled, will strategy produce an exit order and send it to broker?
Strategy logic is not affected by switching the modes. It will work the way it is written. The difference in modes = different starting points of calculation + different visual results on chart.
So, yes or no? Entry order was generated but not filled for some reason, will strategy produce an exit order and send it to broker?
Can I use SA, disregard visual chart-broker position discrepancies on each chart and assume that all entry orders that are filled will be closed correctly?
If you write your code correctly (using MarketPosition_at_Broker and MarketPosition_at_Broker_for_The_Strategy keywords), it will still be able to place orders according to actual position at broker, but in this case the strategy on chart will behave still individually, because chart position in auto-trading engine will be affected only by the orders generated from this exact chart.
As I said, I don't care if broker position is different from the position on chart. I want to make sure that the trading engine can track individual positions opened from different trading strategies on different charts, and close them as needed. As I understand, it's possible, but I need to take special precautions using the keywords you mentioned?

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

Re: Auto trading one symbol, multiple charts  [SOLVED]

Postby Andrew MultiCharts » 06 Dec 2013

So, yes or no? Entry order was generated but not filled for some reason, will strategy produce an exit order and send it to broker?
Possible situation 1:
SA mode, chart A (visual) market position is +1, chart B (visual) market position is -1, strategy auto-trading engine A position is +1, strategy auto-trading engine B position is -1, broker market position is 0, in Orders and Positions Tracker the position match = "false" for both charts, orders will be generated based on auto-trading engine position;

Possible situation 2:
AA mode, chart A (visual) market position is +3, chart B (visual) market position is -2, strategy auto-trading engine A position is +1, strategy auto-trading engine B position is -1, broker market position is 0, in Orders and Positions Tracker the position match = "false" for both charts, orders will be generated based on auto-trading engine position;

Now, let's assume in your code you use "If marketposition_at_broker = ... then begin ...". It will ruin the whole logic, because your code sees market position at broker and according its logic it should generate an order, but auto-trading engine doesn't let it do som because it has a different position.
As I said, I don't care if broker position is different from the position on chart. I want to make sure that the trading engine can track individual positions opened from different trading strategies on different charts, and close them as needed. As I understand, it's possible, but I need to take special precautions using the keywords you mentioned?
Do not use MarketPosition_at_Broker. :-)

AAY
Posts: 56
Joined: 29 Nov 2013
Has thanked: 9 times
Been thanked: 30 times

Re: Auto trading one symbol, multiple charts

Postby AAY » 06 Dec 2013

I made a series of experiments and it seems to be working like I want it to. Thanks Andrew.

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

Re: Auto trading one symbol, multiple charts

Postby MAtricks » 08 Dec 2013

AAY,

Please don't feel obligated, but if you have a moment, would you mind elaborating a bit for the benefit of the forum? I'd like to hear about your experiments and conclusion.

AAY
Posts: 56
Joined: 29 Nov 2013
Has thanked: 9 times
Been thanked: 30 times

Re: Auto trading one symbol, multiple charts

Postby AAY » 08 Dec 2013

My main concern was the ability of Multicharts to track the amount of open positions for the same instrument on different charts. Testing is far from complete, but at least I see that all open entries were closed correctly.

As I said, I trade many instances of similar strategies, with slightly different parameters. This set of strategies generates entry orders at prices close to each other, and at about the same time, within 5-minute window. This produces a lot of visual mess on charts, and it's hard to tell which order belongs to which strategy instance. But when it's time (or price) to close entries, all entries are closed correctly. This I what I tested so far.

I did not test network interruptions and other stuff like this.

I can describe my further experience with this later, when I will have been trading this in production for a month or two.


Return to “MultiCharts”