Position and Orders modify error
Position and Orders modify error
11 May 2020, 18:38
Hello! I just want to modify my pending orders or opened positions. I need to modify TP (for opened positions) or target price + TP (for pending orders).
I'm using this code and getting errors like this "11/05/2020 18:23:05.828 | → Request to amend position PID107086204 is REJECTED with error "Nothing to amend."" , "11/05/2020 18:23:05.703 | → Request to amend order OID172282144 (TP: 6.29999999999686) is REJECTED with error "Nothing to amend.""
If I will modify following code from
double SellLim = barHigh - Dist * 1E-05;
double BuyLim = barLow + Dist * 1E-05;
to
double SellLim = barHigh;
double BuyLim = barLow;
All works fine without any errors.
I just not understand this logic...
Please help me to understand what is going wrong...
Replies
acnestis
12 May 2020, 11:21
RE:
PanagiotisCharalampous said:
Hi robustby,
This message usually appears when the modified parameter is the same as the previous one. To investigate your case further, you need to provide us with the complete cBot source code and cBot parameters to reproduce this message on backtesting.
Best Regards,
Panagiotis
Here is my code.
Problem with following code
var SellLim = barHigh - Dist * 1E-05;
var BuyLim = barLow + Dist * 1E-05;
If I put it instead of
var SellLim = barHigh;
var BuyLim = barLow;
With the code above all working fine.
You can use any of parameters, it's doesn't matter. For example: bar_analyse=20, Dist=5, IndBar=8.
@acnestis
PanagiotisCharalampous
12 May 2020, 14:55
Hi robustby,
Try rounding the values before using them
var SellLim = Math.Round(barHigh - Dist * 1E-05, Symbol.Digits);
var BuyLim = Math.Round(barLow + Dist * 1E-05, Symbol.Digits);
Best Regards,
Panagiotis
@PanagiotisCharalampous
acnestis
12 May 2020, 15:19
RE:
PanagiotisCharalampous said:
Hi robustby,
Try rounding the values before using them
var SellLim = Math.Round(barHigh - Dist * 1E-05, Symbol.Digits); var BuyLim = Math.Round(barLow + Dist * 1E-05, Symbol.Digits);
Best Regards,
Panagiotis
Thank you so much! It's works :)
@acnestis
PanagiotisCharalampous
12 May 2020, 08:23
Hi robustby,
This message usually appears when the modified parameter is the same as the previous one. To investigate your case further, you need to provide us with the complete cBot source code and cBot parameters to reproduce this message on backtesting.
Best Regards,
Panagiotis
Join us on Telegram
@PanagiotisCharalampous