 
    
            Positions.Count for different Symbol
            
                 26 Mar 2014, 10:58
            
                    
I need a command that counts only the positions of a specific Symbol.
Positions.Count But, as I understand it, counts "Total number of open positions".
There is another method that I can use for my needs?
Replies
                     Forex19
                     26 Mar 2014, 11:32
                                    
RE:
Spotware said:
Please look at the following example:
var eurUsdPositionsCount = Positions.Count(p => p.SymbolCode == "EURUSD");
So if I want to have separate count for two Symbol, should I use:
var eurUsdPositionsCount = Positions.Count(p => p.SymbolCode == "EURUSD");
and
var eurGbpPositionsCount = Positions.Count(p => p.SymbolCode == "EURGBP");
is correct?
@Forex19
                     Spotware
                     26 Mar 2014, 11:47
                                    
RE: RE:
Forex19 said:
Spotware said:
Please look at the following example:
var eurUsdPositionsCount = Positions.Count(p => p.SymbolCode == "EURUSD");
So if I want to have separate count for two Symbol, should I use:
var eurUsdPositionsCount = Positions.Count(p => p.SymbolCode == "EURUSD");and
var eurGbpPositionsCount = Positions.Count(p => p.SymbolCode == "EURGBP");is correct?
Yes, it is correct.
@Spotware
                     Spotware
                     27 Mar 2014, 09:09
                                    
RE: RE:
Forex19 said:
Spotware said:
Please look at the following example:
var eurUsdPositionsCount = Positions.Count(p => p.SymbolCode == "EURUSD");
Why gives me this error?:
Error CS1955: Non-invocable member 'cAlgo.API.Positions.Count' cannot be used like a method.
You need to add using System.Linq;
@Spotware

Spotware
26 Mar 2014, 11:20
Please look at the following example:
@Spotware