help with a trading probelm

Questions about MultiCharts and user contributed studies.
cnbiz850
Posts: 33
Joined: 15 Oct 2012
Has thanked: 1 time
Been thanked: 1 time

help with a trading probelm

Postby cnbiz850 » 28 Mar 2014

The problem is basically MC sends a much larger order than my strategy commands.

For instance, when there is a long position of 8 contracts in the account and the strategy commands to short 13 contracts (essentially closing the long position and opening a short position of 5 contracts), it actually sends an order to short 39 contracts.

The number "13" in the example is calculated dynamically in the strategy. The number of contracts shown on the chart are agree with the strategy.

The order is for next bar at market.

Generally, MC trades very reliably for me. But in the past 3 weeks, this type of problem happened 4 times. Seems only with reversal orders. Simple orders seem fine.

I tried to understand what might caused it and also called MC local support about it, but can't find anything wrong.

I am running MC8.5, and it happened both on XP and Win7.

Would anyone kindly speculate what might have caused this problem? Very much appreciated.

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

Re: help with a trading probelm

Postby MAtricks » 28 Mar 2014

Do you have a sample of your execution code that you can share? I'm assuming that the problem lies there.

cnbiz850
Posts: 33
Joined: 15 Oct 2012
Has thanked: 1 time
Been thanked: 1 time

Re: help with a trading probelm

Postby cnbiz850 » 28 Mar 2014

The execution code is simple.

sellshort("S1") -NewLots-Currentcontracts contracts next bat at market;

where NewLots, a negative number, is the number of short contracts I want to open.

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

Re: help with a trading probelm

Postby Andrew MultiCharts » 28 Mar 2014

For instance, when there is a long position of 8 contracts in the account and the strategy commands to short 13 contracts (essentially closing the long position and opening a short position of 5 contracts)...
In this example your code should be:

Code: Select all

sellshort 5 contracts next bat at market;
...it actually sends an order to short 39 contracts.

The number "13" in the example is calculated dynamically in the strategy. The number of contracts shown on the chart are agree with the strategy.
Please print order generation and the the number of contracts to open/close/reverse on every calculation of your strategy. You can find a good example of the "prints" right here.
I am running MC8.5, and it happened both on XP and Win7.
Please download and install latest MC version.

cnbiz850
Posts: 33
Joined: 15 Oct 2012
Has thanked: 1 time
Been thanked: 1 time

Re: help with a trading probelm

Postby cnbiz850 » 29 Mar 2014

Andrew,

Thanks very much for the reply.

My order is just as you advised. Perhaps I have complicated with my description.

I think the essence of my question is this, to put it simply:

Can anyone explain, in terms of number of contracts ordered, why there might be a difference between what is shown on the chart and what is displayed on the order tracker?

As in this example, on the chart it showed 5 contracts being shorted, but the order tracker showed 39 contracts being shorted, and hence the actual number of contract sent to the broker was 39.

I must say that this problem does not always occur when the same piece of code was executed. It happened about 4 in 7 times during the past three weeks.

Upgrading from MC8.5 is not possible for me because the localization version is not available. If you suspect that some known issues in MC8.5 might be related to this, please kindly inform and I will discuss with your local localization agent.

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

Re: help with a trading probelm

Postby Andrew MultiCharts » 31 Mar 2014

Can anyone explain, in terms of number of contracts ordered, why there might be a difference between what is shown on the chart and what is displayed on the order tracker?
What is the mode of auto trading?
As in this example, on the chart it showed 5 contracts being shorted, but the order tracker showed 39 contracts being shorted, and hence the actual number of contract sent to the broker was 39.
What are the values from Strategy Positions tab of Order and Position Tracker window?

cnbiz850
Posts: 33
Joined: 15 Oct 2012
Has thanked: 1 time
Been thanked: 1 time

Re: help with a trading probelm

Postby cnbiz850 » 31 Mar 2014

What is the mode of auto trading?
It is AA with positions set to be the same as chart.
For the example, I did not get that recorded. But I just had another occurrence of the problem yesterday. The case was that it tried to open a long position of 15 contracts when the account and chart has 0 position (the daily trades prior to that were all OK). Instead of sending in 15 contracts, it sent 65 contracts. Trade tracker log also showed 65 contracts, and Strategy Positions tab showed a mismatch of -50 contracts. The number of -50 contracts was a big discovery yesterday as it explains about the 65 number (65 = 15 - (-50)). But my question is how the -50 contracts came?

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

Re: help with a trading probelm

Postby Andrew MultiCharts » 01 Apr 2014

It is AA with positions set to be the same as chart.
In AA mode values on chart can differ from values in Order and Position Tracker window, this is the essence of AA mode.
For the example, I did not get that recorded. But I just had another occurrence of the problem yesterday. The case was that it tried to open a long position of 15 contracts when the account and chart has 0 position (the daily trades prior to that were all OK). Instead of sending in 15 contracts, it sent 65 contracts. Trade tracker log also showed 65 contracts, and Strategy Positions tab showed a mismatch of -50 contracts. The number of -50 contracts was a big discovery yesterday as it explains about the 65 number (65 = 15 - (-50)). But my question is how the -50 contracts came?
I recommend you to use SA mode of auto trading and specify actual broker position for the strategy on start (Show the Assign the Initial Market Position at the Broker Dialogue + Show Always) to avoid synchronization.


Return to “MultiCharts”