Orders Not Executed - Position Sizing BUG

Questions about MCFX and MCFX Data Feed.
kevin kolodzy
Posts: 64
Joined: 25 Jan 2008

Orders Not Executed - Position Sizing BUG

Postby kevin kolodzy » 14 Feb 2008

I am trying to test automated execution with MCFX and Order2Go using a real mini account at FXCM. The trades appear on the chart, but are not executed.

I've set the "Fixed Shares/Contracts" to 10,000 which should be correct for a mini account. The Auto Trading tab is set up with the correct account info and settings.

So far, I haven't been able to see the messages that occur when the trade should be placed, assuming there is an error of some kind. When I tried a few days ago with a demo, I got a message to the effect that the quantity was not a multiple of 100,000.

Interestingly, if I open the position manually via FXCM Trading Station II interface, the Order2Go message popup appeas showing the order.

Any ideas on how to fix this? I generally can't chat live before 5pm ET US, as I'm usually not at the computer earlier (but could have someone monitor it if live chat is the way to solve this).
Last edited by kevin kolodzy on 17 Feb 2008, edited 1 time in total.

beck donald
Posts: 199
Joined: 25 Jan 2008
Has thanked: 2 times
Been thanked: 7 times

Postby beck donald » 14 Feb 2008

Kevin,

Have you been able to properly execute trades on the FXCM demo account? If so, I would think you change the user-name, password and pull-down (from demo to real).

If not...it is in the setup somewhere.

Regards,
Don

kevin kolodzy
Posts: 64
Joined: 25 Jan 2008

Postby kevin kolodzy » 14 Feb 2008

Don,

Yes, demo worked fine, except I never got the hedging turned off. And real signals were generated off of a 10tick chart with a simple moving average cross strategy - just to see it work, which it did.

With all the same settings and account info, I have yet to see a trade from my own strategies get executed. (They've been working well in TS, so I know they work in general.) Hopefully I'll be able to observe what happens when the setup occurs, and note if there is an error message - so far, I haven't, and trades are not so frequent that I can always anticipate when one will occur.

beck donald
Posts: 199
Joined: 25 Jan 2008
Has thanked: 2 times
Been thanked: 7 times

Postby beck donald » 14 Feb 2008

Weird one.

kevin kolodzy
Posts: 64
Joined: 25 Jan 2008

Postby kevin kolodzy » 15 Feb 2008

It gets stranger! This morning I checked the various charts and automation settings, and found that it had turned ITSELF off overnight. I had to reenable automation on the charts.

I'm wondering if there is a timeout issue, or if it somehow shuts off if there is a data interruption, for example.

Marina or someone - is there a log file that tracks connection and other events?

kevin kolodzy
Posts: 64
Joined: 25 Jan 2008

Buy X contracts BUG

Postby kevin kolodzy » 17 Feb 2008

I watched a signal hit, and it was NOT executed.

The popup said something to the effect that the quantity must be divisible by 10000 (it's a mini account).

On the format strategy dialog the fixed shares/contracts is set to 10000 and the max to 50000.

The strategy issues a buy for 1 contract. Does the strategy have to be modified as well? This should not be necessary unless there is a bug in the code that causes it to work differently than TS. (I see that the sample strategy code does not specify quantity, so perhaps that's why it worked during initial tests - e.g., the MovAvg Cross LE simply buys next bar at market without quantity specified.)

EDIT: Confirmed BUG. The strategy must be modified to buy X units instead of contracts, so X must be multiplied by the number of units in a contract: 10,000 for a mini, and 100,000 for normal. This is NOT compliant with TS usage, so strategies using position sizing will NOT work without modification.

Furthermore, the signal did not appear on the chart until 2 minutes AFTER the condition was met - 2 min AFTER the start of the bar (and there were ticks coming in).

beck donald
Posts: 199
Joined: 25 Jan 2008
Has thanked: 2 times
Been thanked: 7 times

Postby beck donald » 17 Feb 2008

It makes no sense that a demo account would require a strategy to be coded one way and a live account another. If that's happening, then something must be up on the FXCM side of things... just can't figure out what that could be.

Don

kevin kolodzy
Posts: 64
Joined: 25 Jan 2008

Postby kevin kolodzy » 17 Feb 2008

This is a real account, Don. My strategy uses money management/position sizing logic to determine the number of contracts. In TS, 1 contract with a standard account is 1 full-size lot, and the trade is executed as 1 lot. However, in MCFX, I would have to specify a buy of multiples of 100,000 units (100,000 for 1 contract, 200,000 for 2 contracts; 10,000 for one mini-lot, etc.).

So, specifiying 1 or 2 contracts in the Buy command does not work correctly in MCFX when the Buy command syntax includes # of contracts to buy. Instead of saying Buy ("LE") X Contracts next bar at market, I have to code Buy ("LE") X * MCFXsizeFactor Contracts next bar at market, where MCFXsizeFactor is an input set to 10,000 for minis and 100,000 for standard lots.

beck donald
Posts: 199
Joined: 25 Jan 2008
Has thanked: 2 times
Been thanked: 7 times

Postby beck donald » 17 Feb 2008

I was clear on your communication and understand the issue. Maybe incorrectly, but I have been assuming your problem only appears on a live account and not a demo account which was causing my head scratch. Guessing that on the demo you didn't have your MM logic in place and the issue did not appear?

Don

kevin kolodzy
Posts: 64
Joined: 25 Jan 2008

Postby kevin kolodzy » 17 Feb 2008

I didn't try this strategy on a demo account - I only tried a simple strategy that did not have any sizing parameters. And my first experiments with the real account used the included moving average cross LE and LX strategies, which do not use any position sizing - they simply Buy/Sell next bar at market.

So, the problem only appeared when trying to specify the number of contracts in the order syntax, which I only tried on the real account.

beck donald
Posts: 199
Joined: 25 Jan 2008
Has thanked: 2 times
Been thanked: 7 times

Postby beck donald » 17 Feb 2008

Got it. My guess is that the size the order to some degree controlled by the broker and in this case because both mini and standard lot sizes can be traded. Personally, I would prefer everything to operate in dollars. My strategy code being a value of 1 and the signal properties to be set at 10000 for a mini and 100000 for a standard. So long as the values are correct throughout the software, I will adjust to anything that will work!

Good luck
Don

User avatar
Andrew Kirillov
Posts: 1589
Joined: 28 Jul 2005
Has thanked: 2 times
Been thanked: 31 times
Contact:

Postby Andrew Kirillov » 18 Feb 2008

This is a real account, Don. My strategy uses money management/position sizing logic to determine the number of contracts. In TS, 1 contract with a standard account is 1 full-size lot, and the trade is executed as 1 lot. However, in MCFX, I would have to specify a buy of multiples of 100,000 units (100,000 for 1 contract, 200,000 for 2 contracts; 10,000 for one mini-lot, etc.).

So, specifiying 1 or 2 contracts in the Buy command does not work correctly in MCFX when the Buy command syntax includes # of contracts to buy. Instead of saying Buy ("LE") X Contracts next bar at market, I have to code Buy ("LE") X * MCFXsizeFactor Contracts next bar at market, where MCFXsizeFactor is an input set to 10,000 for minis and 100,000 for standard lots.
Kevin,
You are right. MCFX thinks in terms of dollars rather than lots. So if you need 1 full contract you should specify 100,000. If you need 1 mini lot, specify 10,000.
Important note:
The script overrides your money management settings in the properties dialog. So you either specify number of units in the script, or don't indicate 1 contract at all and set in the properties dialog.
We never encountered lags or automatic turning off. So you can send us your logs
\Documents and Settings\your_name\Local Settings\Application Data\TS Support\MCFX Pro\1.1.1119.244\Logs\TradingServer\fxcmtradingsystem_trace.txt

We are developing new auto-trading with FXCM that will support stop & limit orders. We are going to put more efforts to make it robust and efficient.

kevin kolodzy
Posts: 64
Joined: 25 Jan 2008

Postby kevin kolodzy » 18 Feb 2008

Andrew,

I'm looking forward to your support of both stop and limit orders - I hope the syntax and implementation will not require major coding changes to existing strategies, but it is more important that it work robustly vs. any minor inconveniences to modify my code.

Now that I've figured out that the MCFX/FXCM order syntax is fundamentally different that the way TS works, I can deal with it. I was expecting that I would not have to change my code to make this work, but it is a minor change so is no longer a problem.

User avatar
Andrew Kirillov
Posts: 1589
Joined: 28 Jul 2005
Has thanked: 2 times
Been thanked: 31 times
Contact:

Postby Andrew Kirillov » 18 Feb 2008

Now that I've figured out that the MCFX/FXCM order syntax is fundamentally different that the way TS works, I can deal with it.
Could you highlight differences?
I was expecting that I would not have to change my code to make this work, but it is a minor change so is no longer a problem.
We will support native TS command like buy... stop or sell... limit, setstoploss, setprofittrarget and settrailingstop.

Let me know if miss something.

kevin kolodzy
Posts: 64
Joined: 25 Jan 2008

Postby kevin kolodzy » 18 Feb 2008

Andrew,

Your 4:16pm post today quoted my post that highlighted the basic difference - having to multiply number of contracts by the number of units per contract to comply with FXCM order sizing standards (which differ from the basic TS sizing that only needs number of contracts/lots - as I mentioned, not a problem now that I understand the difference).

I think you've achieved compatibility with TS order entry and exit commands so far, it's just that FXCM position sizing is in units, not contracts/lots.

User avatar
Andrew Kirillov
Posts: 1589
Joined: 28 Jul 2005
Has thanked: 2 times
Been thanked: 31 times
Contact:

Postby Andrew Kirillov » 18 Feb 2008

we will consider the lots in the next version...


Return to “MCFX”