willyvusi04
willyvusi04's avatar

Info

Username:willyvusi04
Name:willyvusi04
Member since: 15 May 2020

About

None

Signature

None

Last Forum Posts

@Closing headging trades with a profit:  15 May 2020, 09:46


PanagiotisCharalampous said:

Hi willyvusi04,

You can try something like the below

           if (Positions.Sum(x => x.NetProfit) > 0)
            {
                foreach (var position in Positions)
                    position.Close();
            }

Best Regards,

Panagiotis 

Join us on Telegram

Thank you so much

@Closing headging trades with a profit:  15 May 2020, 02:21


Hello, I'm still new in developing c bots.

Is there a way to close specific hedging positions which their profit and loss add up to 0 or more?

Example :

*6 buy positions 

*4 sell positions 

When all 6 buy trades are in loss, if 1 of the loosing trades  has a loss of - 10 usd.

And then all the 4 sell trades are in profit. But it happens that 1 of the winning trades has a profit  of 10+.

(I need the code to close hedging positions which add up to  0 or more.)

So it will mean now trades that will be left will be 

*5 buy trades and 3 sell trades. 

(Basically the same process over and over just to reduce loosing trades.) 

If this can be possible, I would appreciate a sample code. 

Thank you in advance. 

Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.

No uploaded.

Warning! Executing cBots downloaded from this section may result in loss of funds. Use them at your own risk.

No uploaded.