numLong (string name): int

numShort (string name): int

valLong (string name): var

valShort (string name): var

Returns the number resp. the current profit of all open long resp. short trades with the current asset and a given name. This function is often used to limit the number of open trades for a certain trade algorithm, thus reducing the risk.


name - optional algorithm identifier of max. 15 characters, or 0 for the current algorithm, or "*" for finding all trades of the current asset regardless of their algorithm.


Number of open trades (numLong/numShort)
Total current profit of open trades (valLong/valShort)



if(numShort("Cycle") < 3) // only 3 open trades of type "Cycle"

See also:

exitLong/Short, enterLong/Short, statusLong/Short, WinLong/Short

► latest version online