From wiki :
MarketPosition_at_Broker_for_The_Strategy
Will will return '17' if the current position at the broker for the strategy is 17 contracts long.
Will return '-132' if the current position at the broker for the strategy is 132 contracts short.
Will return '0' if the current position at the broker for the strategy is flat.
Will return '0' if the Automated Trading Mode is not turned on.
does this only work if I have a broker account attached to multichart?
It keeps returning 0.
With no broker, try
MarketPosition + CurrentContracts
http://www.multicharts.com/trading-soft ... etPosition
http://www.multicharts.com/trading-soft ... tContracts
MarketPosition(0) * CurrentContracts
Will return a value of "-9" if the strategy is short 9 contracts, and will return a value of "4" if the strategy is long four contracts.
MarketPosition : to know if long or short
Returns a numerical value, indicating the type of the specified position.
A value of 1 indicates a long position, -1 indicates a short position, and 0 is returned only if the current position is specified and indicates that the current position is flat.
CurrentContracts :
CurrentContracts returns an absolute value for both long and short positions.
This function can only be used in signals.
To use the CurrentContracts or CurrentShares in an indicator, see i_CurrentContracts and i_CurrentShares respectively.