Portfolio sizing question
Posted: Dec 09 2011
I'm developing a strategy that currently trades four e-mini futures symbols (@EMD, @ES, @NQ and @YM). It's a gap-open strategy that sometimes opens a position, and sometimes does nothing, depending on whether the "buy" criteria are met for any given symbol at the open of the day session.
I would like to set this up so that the strategy allocates 50% of the available equity to the first symbol that triggers an entry, allocates the remaining 50% of the available equity to the second symbol that triggers an entry, and does nothing for any remaining symbols that trigger an entry. For example, if I have $50K of available margin, it might place an entry for up to $25,000 worth of @EMD contracts, up to $25,000 worth of @ES contracts, and nothing for the remaining symbols (because the available margin is exhausted).
Can anyone point me in the right direction for code that would accomplish this? For example, are there any keywords to determine the total number of filled or pending orders for this strategy, for all symbols? I.e., so that I could determine whether zero, one, or two orders have already been placed?
Alternatively, are there any keywords that let met determine the total equity that is available for trading? Or would I just need to "roll my own" solution using the All Data Everywhere module to keep track of the total number of entries for the strategy?
If anyone can point me to any existing code, so that I don't need to reinvent the wheel, I'd greatly appreciate it. Many thanks in advance.
I would like to set this up so that the strategy allocates 50% of the available equity to the first symbol that triggers an entry, allocates the remaining 50% of the available equity to the second symbol that triggers an entry, and does nothing for any remaining symbols that trigger an entry. For example, if I have $50K of available margin, it might place an entry for up to $25,000 worth of @EMD contracts, up to $25,000 worth of @ES contracts, and nothing for the remaining symbols (because the available margin is exhausted).
Can anyone point me in the right direction for code that would accomplish this? For example, are there any keywords to determine the total number of filled or pending orders for this strategy, for all symbols? I.e., so that I could determine whether zero, one, or two orders have already been placed?
Alternatively, are there any keywords that let met determine the total equity that is available for trading? Or would I just need to "roll my own" solution using the All Data Everywhere module to keep track of the total number of entries for the strategy?
If anyone can point me to any existing code, so that I don't need to reinvent the wheel, I'd greatly appreciate it. Many thanks in advance.