Normalized quantities for auto-trading client

I am confused regarding the quantities published by C2 through the CTATI. Specifically I want to obtain the quantity say mini-lots in forex published from the system normalized to say 100,000 equity. What isn’t helpful to me as a developer is the possibility that system X enters trades assuming a fixed 100K account and another that is basing trade sizes off the C2 account balance that is growing at a different rate than my target account to be auto traded. In the later scenario one would have to constantly go into C2 and adjust the scaling factor to compensate. Could I suggest a new field “NormalizedQuant” that auto scales the system supplied trade quantities to a fixed account size? Option 2 would be to publish a flag stating how the developer is publishing trade size (fixed to XXX equity, or sized to model account) in addition to the model account size. Hope this makes sense. Thanks!

Matt:



The C2 AutoTrading API (C2ATI) is designed for use by programmers looking to AutoTrade a trading system. A key part of any trading system, of course, is money management. Thus, the C2ATI tells your software (and then, presumably, your broker) how much of something to buy or sell.



Because the C2ATI is meant to be used to build “light-weight” client software that does not need to track a lot of state information, the signal quantity number C2 delivers to your software already has a lot of information baked into it. Specifically, when C2 delivers a signal to your software, the quantity attached to that signal is based on three pieces of information:



1) The nominal amount traded in the system’s Model Account



2) The scaling preferences of the end-user customer who will be doing the trading (e.g. the “scaling factor” and also min/max unit-size constraints). Remember that these scaling preferences are set by the end-user through the C2 Web site. In cases where someone is developing commercial software for use by other customers, the person setting scaling preferences on C2 will not be the same person writing the software. In other cases (presumably like yours) where the software developer is writing C2 AutoTrading software for his own use, then the programmer and the trader will be the same person. Even so, quantity preferences are still set on the C2 web site, outside of the view and control of your software.



3) Finally, in cases of closing orders: the quantities sent to your software are also affected by whether or not your software previously reported the filling of matching opening orders (i.e. we try not to close more than we open)



If you simply want to know the nominal trading system trade amounts – that is, the actual numbers that a system vendor “types into” the C2 platform (or that his own software enters, in the case of signal-entry automation) – then the C2ATI probably isn’t what you want. You should probably look instead at the C2 Data Services API (http://www.collective2.com/C2DS.pdf) which has a nifty set of commands (establishstatus and checkin) which let you poll for latest changes in signals, positions, etc., and do with them as you wish.



Let me know if I am misunderstanding your question entirely, or if you need further clarification about the information above.



Matthew

Hi Matthew,



Thank you for the prompt reply. Here is the problem defined a bit better. Say I subscribe to 3 forex trading systems on C2 and want to auto-trade my own account. My account will have a different equity than the model accounts (obviously). By scaling down the 3 C2 systems trade sizes to “fit” my account seems like it would require constant attention to the scaling factor for each of the 3 systems that I would have to manage on C2’s website. What I am aiming for is giving a bit more of that control back to my auto-trading software. The problem I fear is that if system X is doing really well (say 20% a month) system X’s lot sizes and by proxy scaled lot quantities from C2 will increase. The scary part of this is if I am not constantly on top of the scaling factors for each account AND my live account balance isn’t growing at the same rate such as systems Y and Z actually reduce the value in my account, eventually system X will start placing “scaled” trades that are too large for my target account.



I believe I can work around this what I believe to be a limitation, but since you seem like a reasonable guy would ask if there is some way of you publishing a normalized quantity value in addition to the ones you already published?



Having a scaled quantity to a fixed hypothetical account balance say 100K would allow me to do simple scaling myself in my client. In my case I would subscribe to 3 systems X,Y,Z and give each of them 33% of their normalized quantities based of the model 100K account. My client would then simply perform a little math to convert the normalized account sizes * 0.33 by the actual account equity I have as compared to the 100K model.



My client of course will publish the actual lots filled to C2 for further management.



Hopefully this makes sense. I am hoping that you are able to implement my suggestion, it will be much harder for me to use the data API to try and reverse engineer out a normalized lot sizing for the calculations I require.



Thank you,



Sincerely,



Matt Standing

Sr.Software Architect

But I disagree with your premise. Your real trading account will grow or decrease correspondingly with the C2 Model Account. That’s the point. That’s the goal, not the problem to be overcome.



For example, let’s say you AutoTrade a System that has $100,000 USD in its C2 Model Account. Imagine that you don’t have $100,000 in your real account, but rather you just have $10,000. So you set your scaling factor to 10%.



Meaning: you will place trades at 1/10th the value of the C2 Model.



Now, imagine that the C2 system gains 50% on C2. Its equity on C2 is now $150,000. Your real trading account in theory will also gain 50% and will now have $15,000. Thus, your real trading account will continue to be in a position to trade at the same 10% scaling factor it always has. In theory there is no need to adjust your scaling factor as the system performs well (or poorly).

Continuing my thoughts… I would subscribe to C2 system X,Y, and Z and on C2 website set the scaling factor to 33% each. All that would need to be added to the C2ATI xml for new orders would be a scaled quantity at a fixed account reference size say 100K. This simple? change would prevent imbalanced scaling factors from discrepancies between each systems model account growth against my target auto-traded actual growth.



Thanks Matthew.



Matt

quote: But I disagree with your premise. Your real trading account will grow or decrease correspondingly with the C2 Model Account. That’s the point. That’s the goal, not the problem to be overcome.



Matthew, I can only somewhat agree with your statement if the auto-trading client is trading one and only one system. Even then I would believe that model account equity and live equity would diverge after some time due to impartial fills, slippage, and even missed entries. As soon as you add multiple systems to be auto-traded I don’t see how C2ATI can properly send scaled quantities unless you somehow have knowledge of what my actual account equity I have? Maybe I missed something (forgive me if I have) in the docs but I don’t recall any sync between my live account equity and what C2 believes I have.



I feel that a one way scaling with no equity sync back to C2 or implementing the normalized scaled quantities which I desire will result in imbalances for the scenario (multiple systems traded live).



Sorry if I sound confrontational, just trying to figure out how to solve my problem and to have you see what I perceive as a problem.



Thanks again Matthew.

The situation with multiple systems is the same as the situation with single systems.



As each system grows or shrinks in its equity, that slice of your account allocated to a specific system will grow or shrink by the same percentage as the system you follow in that slice. In other words, each piece of your account, allocated to each system, will have enough equity to handle that one system. When a system does terribly, its Model Account equity on C2 will shrink, too, forcing it to place smaller and smaller trades, which get translated to smaller and smaller trades (on a nominal basis) in your account.



Now, if your point is that there will be tracking error between the Model Account and your own account, that is true and undeniable. Over time, that tracking error (slippage, missed fills, software errors, etc.) will grow, and will inspire you to rebalance your autotrading configuration (i.e. to rejigger the various scaling %'s for each system you are following).



Tracking error is one important thing, but it not the only reason you will want to rebalance. In the same way that a mutual fund needs to rebalance its portfolio after one particular stock that it chose had a great run and turned out to be a huge winner (thereby making the fund too heavily concentrated in that position), so too will a user want to check his autotrading configuration periodically to make sure that a “successful” system doesn’t represent too much of his portfolio for his own comfort level.



These are important implementation issues, and I am glad you raise them. My main concern in this series of posts is to push on the notion that a programmer needs nominal trade size information within the C2ATI because otherwise an account will not have enough equity in cases where the trading system you are following does well. My point is that your account will (tracking error aside) mirror the system you are following. To put it more visually: the pie slice in your account which is allocated to a given system will shrink or grow, along with the system you are following.



That said, if you decide you want nominal trade size information, it is available in the C2 Data Services API, referenced above.



Also, tangentially related to this: we have put together a page of information about Common Pitfalls of autotrading. You can see it here:



www.collective2.com/static/pitfalls.htm

I can live with this. You are correct that re-balancing each slice of the pie over time is necessary. Thank you.



I logged a request for CTATI access yesterday, hoping that will get enabled soon. I can’t wait :slight_smile:



Thank you,



Sincerely,



Matt Standing