Topics
Replies
lgwsyqnfr
23 Mar 2019, 12:08
double buylots =0, selllots =0; foreach (var position in Positions) { if (position.SymbolCode == Symbol.Code) { double lot = position.VolumeInUnits; if (position.TradeType == TradeType.Buy) { buylots += lot; } if (position.TradeType == TradeType.Sell) { selllots += lot; } } }
@lgwsyqnfr
lgwsyqnfr
23 Mar 2019, 12:05
I am newer cBot from mql. Ithink you can do so:
foreach (var position in Positions)
{
if (position.SymbolCode == Symbol.Code)
{
double lot = position.VolumeInUnits;
if (position.TradeType == TradeType.Buy)
{
buylots += lot;
}
if (position.TradeType == TradeType.Sell)
{
selllots += lot;
}
}
}
@lgwsyqnfr
lgwsyqnfr
24 Mar 2019, 13:43 ( Updated at: 21 Dec 2023, 09:21 )
RE:
2bnnp said:
Thanks your help. but i still get it.
One of the reasons why MT4 and 5 are so popular is that MQL has detailed practical application examples, so, anyone can write its own program according to the examples. CTrader does very poorly in this respect, after all, most traders are not professional programmers. Therefore, cTrader has a long way to go before it can be popularized in the market.
@lgwsyqnfr