My trading system generates both buy/sell and short/cover signals for futures. The futures contract I wish to trade needs 8% margin to take position.
Now I have set the required setting in the Trading System - Settings - Futures.
In Capital settings - I have merged both buy & short categories and set max positions to 1 so that a short signal closes a long position if there is one and then opens a short position.
Everything is working fine except when the system generates a short signal when there is an existing long position.
On the day when the long position is closed and a new short position is opened - the size of the short position is much larger than what my capital allows.
Symbol Trade Entry Exit Perf Profit Shares Pos. value
NIFTYFUTIDX-NEAR Long 17-05-13 0:00 22-05-13 0:00 -0.010251353 -123764.6493 1950 840011.1507
NIFTYFUTIDX-NEAR Short 22-05-13 0:00 24-05-13 0:00 0.019879195 2969266.263 24375 14897221.26
Ideally, the trading system should close the long position of 1950 contracts and open a new short position of 1950 contracts.
But it is opening a new short position of 24375 contracts. My capital certainly does not allow for such a huge position, unless the system is considering the entire long position value (not just the 8% margin deposited) to be my capital.
The numbers certainly hint this way. If the entire value of 1950 contracts is assumed to be my capital then I can put that as margin for a short position of 24375 contracts.
The bug could be in the Trading System - Settings - Capital - Orders - Pending Orders = Market Orders.
While calculating the value of a position taken with a margin it is assuming the value to be its entire value.
Can someone throw more light on this wierd behaviour.
Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.