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

13 Aug 2019, 15:31modify Problems in some symbols (Stoploss and TakeProfits Format i think)#1
ctid990337posts: 3since: 13 Aug 2019

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

13 Aug 2019, 15:47where#2
ctid990337posts: 3since: 13 Aug 2019

this happen in symbol: PLNJPY.

thanks

13 Aug 2019, 16:17#3
Panagiotis Charalampousposts: 3188since: 13 Jan 2017

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
13 Aug 2019, 18:56#4
ctid990337posts: 3since: 13 Aug 2019

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...

14 Aug 2019, 08:51#5
Panagiotis Charalampousposts: 3188since: 13 Jan 2017

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