Finding BUY / SELL positions.

Created at 19 Oct 2021, 11:31
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
P.

p.snarski

Joined 23.07.2020

Finding BUY / SELL positions.
19 Oct 2021, 11:31


I am just starting with coding. I can find all position open:

    public Position[] botPositions
    {
        get { return Positions.FindAll(Label); }
    }

Click to copy

but I have no idea how syntax would look like if I want cBot to check if there is open position => check if it is Buy or Sell and run the correct code.

Thanks for any help!


@p.snarski
Replies

ClickAlgo
29 Oct 2021, 14:52 ( Updated at: 29 Oct 2021, 14:53 )

Hi, Peter,

 

I know we replied to this on our forum, but I thought I would share the link to help other people as we gave a comprehensive answer.

 


@ClickAlgo