The problem would seem to be that Chart Trader and Strategies each run in their own sphere (or virtual machine) and that neither one has acess to the other. However, through the Strategy method 'PositionAccount.MarketPosition', this may be enough.
Consider the following scenerio. Chart Trader places a buy order with no ATM management, no stop, target, auto trail...etc. A 'TradeMgmt' Strategy is running on the same instrument (separate chart) and picks up the trade entry when 'PositionAccount' shows that the account postion has changed from flat to long (which must have been initiated by the Chart Trader since 'TradeMgmt' Strategy never initiates trades on its own). Essentially, TradeMgmt stops are implemented by taking the reverse side of the Chart Trader entires. So at the end of the trading day (and assuming all buys), Chart Trader would show 5 longs active, and TradeMgmt Strategy would show 5 short positions active, with the net result that the TradeMgmt Strategy implemented the stops (according to whatever alogrithm was programmed) and the account is flat, as it should be.
Would this solution work? Are there any major pitfalls you see? For example, a very active trader could run the totals up to +100 active buys and sells at the end of the day. And of course, is there a better way to do this??
Comment