modify Problems in some symbols (Stoploss and TakeProfits Format i think)

ctid990337 since: 13 Aug 2019; 
 13 Aug 2019, 15:31
modify Problems in some symbols (Stoploss and TakeProfits Format i think)

Hi! comunity... first of all thanks for all respond...

well I resucite and old code that says
 

double? newStopLoss= Symbol.Ask - 10*Symbol.PipSize;
double? newTakeProfits= Symbol.Ask + 10 * Symbol.PipSize;

ModifyPosition (position, Math.Round(Convert.ToDouble(newStopLoss), symbol.Digits), Math.Round(Convert.ToDouble(newTakeProfits), symbol.Digits));

so, few years ago i format newstoploss and newtakeprofits with a rounded symbol.digits, but that force to convert to double for math to work. with this code i receive and error of "technical error" in live account

i change code to normal modify

ModifyPosition (position, newStopLoss, newTakeProfits);

and now i receive error (only in some symbols): "Nothing to amend"

13/08/2019 12:20:29.835 | → Request to amend position PID96311600 (SL: 75.905) is REJECTED with error "Nothing to amend."

-------------------

can someone give me a post where stoploss/takeprofits format and limits are explained? and some code to format?

regards

software: calgo on windows 10

ctid990337 since: 13 Aug 2019; 
 13 Aug 2019, 15:47
where

this happen in symbol: PLNJPY.

thanks

Panagiotis Charalampous's avatar
Panagiotis Charalampous since: 13 Jan 2017; 
 13 Aug 2019, 16:17

Hi ctid990337,

Thanks for posting in our forum. The message means that the values are identical with the previous ones. It would be better to check if the new stop loss and take profit are different from the existing ones before you try to modify them.

Best Regards,

Panagiotis

Head of Community Management at cTrader
ctid990337 since: 13 Aug 2019; 
 13 Aug 2019, 18:56

thanks Panagiotis, and this one?

13/08/2019 13:15:13.151 | → Request to amend position PID96311612 (SL: 4.00000) is REJECTED with error "New SL for BUY position should be <= current BID price. current BID: 387431, SL: 400000;  "

in the position info (sl: 4.00000 with a point) and in error (400000 with no point) something strange happend...

Panagiotis Charalampous's avatar
Panagiotis Charalampous since: 13 Jan 2017; 
 14 Aug 2019, 08:51

Hi ctid990337,

The message is clear. You cannot place a stop loss higher than the bid price.

Best Regards,

Panagiotis

Head of Community Management at cTrader