You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I think i understood the double variable and the floating-point and now i think i have the right value for SL and TP, in fact i can open some order successfully!
The problem is that for some order i still have the 130 error from the ordersend, but the thing more strange is that i get the same error if i set the SL and TP value direcly from code and with the same values :(
Instead, if i open the order from the smartphone app with the same parameters it works!
This could still be a problem with the correct SL value fit?
I think i understood the double variable and the floating-point and now i think i have the right value for SL and TP, in fact i can open some order successfully!
The problem is that for some order i still have the 130 error from the ordersend, but the thing more strange is that i get the same error if i set the SL and TP value direcly from code and with the same values :(
Instead, if i open the order from the smartphone app with the same parameters it works!
This could still be a problem with the correct SL value fit?
By debugging the code, i see that during the conversion from String to Double the function add some decimal value (and i don't know why), so for example 1.07866 in string become 1.07866000000001 in double.
You can try this solution:
And use it to round the SL
Finally, you need to check you SL for your broker's stop level.
see the graph here https://www.mql5.com/en/forum/461774#comment_52124875 ,
and also the MQL4 book here https://book.mql4.com/appendix/limits
You can try this solution:
And use it to round the SL
Finally, you need to check you SL for your broker's stop level.
see the graph here https://www.mql5.com/en/forum/461774#comment_52124875 ,
and also the MQL4 book here https://book.mql4.com/appendix/limits
Thank you for you suggestion, but unfortunalty i get the same error 130 with your code :(
These are my SL, TP and TICKSIZE parameters (calculated by your function):
And these are the Ask price, the MODE_STOPLEVEL, the Point and the Digits parameters (if they can help you):
Christian
Thank you for you suggestion, but unfortunalty i get the same error 130 with your code :(
These are my SL, TP and TICKSIZE parameters (calculated by your function):
And these are the Ask price, the MODE_STOPLEVEL, the Point and the Digits parameters (if they can help you):
Christian
Sorry, i wrote the wrong values (a little confusion due to the multiple test), these are the parameters about a failed order retrieved by the MetaEditor debugger:
These are the OrderSend parameters:
Sorry, i wrote the wrong values (a little confusion due to the multiple test), these are the parameters about a failed order retrieved by the MetaEditor debugger:
This is the code to open the order:
The parameters are in a string array (called order_params) where each row is a parameter.
In Telegram i send a command like this:
So the parameters are separeted by ';' and then they are splittend in the string array.
The sintax is:
and the function to split:
Christian
PS: the function RoundPriceToStep was suggested by the user @amrali above
This is the code to open the order:
The parameters are in a string array (called order_params) where each row is a parameter.
In Telegram i send a command like this:
So the parameters are separeted by ';' and then they are splittend in the string array.
The sintax is:
and the function to split:
Christian
PS: the function RoundPriceToStep was suggested by the user @amrali above
This is the code to open the order:
The parameters are in a string array (called order_params) where each row is a parameter.
In Telegram i send a command like this:
So the parameters are separeted by ';' and then they are splittend in the string array.
The sintax is:
and the function to split:
Christian
PS: the function RoundPriceToStep was suggested by the user @amrali above