How modify TP of multiple orders on one pair

Created at 09 Nov 2015, 01:34
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!
FA

fahdjeddah

Joined 08.11.2015

How modify TP of multiple orders on one pair
09 Nov 2015, 01:34


Hi,

Is there any way to modify TP(target) or SL (Stop loss) of multiple orders on one pair at same time? in MT4 there was script that when i drop the script in any price of chart all orders change TP to that point and another script to change SL to any price i click


@fahdjeddah
Replies

Spotware
09 Nov 2015, 17:59

Dear Trader,

You could loop through all positions with the same symbol and modify the TP or SL. The following code snippet loops though all positions and if the Symbol of the position is EURUSD it prints the word "Hello" in the log.

            foreach (var position in Positions)
            {
                if (position.SymbolCode == "EURUSD")
                {

                    Print("hello");
                }
            }

 


@Spotware

fahdjeddah
09 Nov 2015, 22:44

RE:

Spotware said:

Dear Trader,

You could loop through all positions with the same symbol and modify the TP or SL. The following code snippet loops though all positions and if the Symbol of the position is EURUSD it prints the word "Hello" in the log.

            foreach (var position in Positions)
            {
                if (position.SymbolCode == "EURUSD")
                {

                    Print("hello");
                }
            }

 

Thank you .

can you please me show me these point:

what code or function i have to use to change the TP to place i click by mouse?

 


@fahdjeddah

Spotware
10 Nov 2015, 15:26

Dear Trader,

To modify an order you use the ModifyPendingOrder method.

We recommend you to have a look at the API Programmers Guides section of cTDN.com


@Spotware