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.
help with a trading probelm
Re: help with a trading probelm
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.
sellshort("S1") -NewLots-Currentcontracts contracts next bat at market;
where NewLots, a negative number, is the number of short contracts I want to open.
- Andrew MultiCharts
- Posts: 1587
- Joined: 11 Oct 2011
- Has thanked: 931 times
- Been thanked: 559 times
Re: help with a trading probelm
In this example your code should be: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)...
Code: Select all
sellshort 5 contracts next bat at market;
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....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 download and install latest MC version.I am running MC8.5, and it happened both on XP and Win7.
Re: help with a trading probelm
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.
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.
- Andrew MultiCharts
- Posts: 1587
- Joined: 11 Oct 2011
- Has thanked: 931 times
- Been thanked: 559 times
Re: help with a trading probelm
What is the mode of auto trading?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 are the values from Strategy Positions tab of Order and Position Tracker window?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.
Re: help with a trading probelm
It is AA with positions set to be the same as chart.What is the mode of auto trading?
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?What are the values from Strategy Positions tab of Order and Position Tracker window?
- Andrew MultiCharts
- Posts: 1587
- Joined: 11 Oct 2011
- Has thanked: 931 times
- Been thanked: 559 times
Re: help with a trading probelm
In AA mode values on chart can differ from values in Order and Position Tracker window, this is the essence of AA mode.It is AA with positions set to be the same as chart.
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.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?