If you read the question I stated the code is copied DIRECTLY from this website in the examples section and was written by Mike.
https://ctrader.info/d/112-total-profit-of-all-positions-by-label
The only additional brackets in my code were just trying to work out the errors which Mikes code brings as stated above. But I cannot and so I queried it on here.
I cannot reply to the original feed of messages because it has been closed and moved to examples.
foreach (var p in positions)
{
ClosePosition()p);
}
this code written by Mike on here gives these errors:
However when I try to use this I get four errors:
; expected
; expected
} expected
No overload method for ClosePosition
These all occur on the ClosePosition()p); line.
I was asking for help as to why these errors occur as I cannot work out why.