Hi there,
I need my system to know how long/short I am in the market even though I, personnally, can’t/ could not possibly know…
Below piece of code assumes that I have been building up on positions..
Is this going to work? :
countof(long/short)shares = cumsum(countof(long/short)shares)
Thanks for your replies
You don’t need to do any math.
CountOfLongShares and CountOfShortShares return the data you need. Since you cannot have Long and Short trades opened at the same time, that’s all you need.
CountOfPosition returns the same data, but as a positive number for Long trades and negative numbers for Short trades (you may use ABS() to work this around).
They return data relative to the current strategy, since knowing what other strategies do is not currently supported.