
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
please check below logs with bid and ask price and error
2023.06.18 00:21:53.281 2022.06.07 23:25:00 bid price132.629 ask price132.631
2023.06.18 00:21:54.339 2022.06.07 23:25:00 failed sell limit 3.08 USDJPY at 132.628 sl: 132.671 tp: 132.542 [Invalid price]
Answers to questions
please check below logs with bid and ask price and error
2023.06.18 00:21:53.281 2022.06.07 23:25:00 bid price132.629 ask price132.631
2023.06.18 00:21:54.339 2022.06.07 23:25:00 failed sell limit 3.08 USDJPY at 132.628 sl: 132.671 tp: 132.542 [Invalid price]
Answers to questions
Documentation:
You4 code should always check error codes and trade results codes and adjust to them.
You should learn to debug your own code and reference the documentation.
I have given you links, and suggestions. Now you need to do some research and put them into practice on your code.
Don't use pending orders so near to current market prices. Use Market orders instead.
NB! I did however make a mistake in my posts, You should in fact be checking the Freeze Level in respect to the open price of pending orders
The Stops Level is for checking against the Stop Prices, I have corrected my previous posts.
Make sure to read and apply the following ...
I have also tried with sell market order but still facing issue. will do some research based on your posts. thx for help
2023.06.18 01:06:16.473 2022.06.07 23:25:00 bid price132.629 ask price 132.631
2023.06.18 01:06:16.473 2022.06.07 23:25:00 Trade error code 10015
2023.06.18 01:06:16.474 2022.06.07 23:25:00 failed sell 0.09 USDJPY at market sl: 133.998 tp: 129.889 [Invalid price]
2023.06.18 01:06:16.474 2022.06.07 23:25:00 last error reported 4756
ansar9h #: I have also tried with sell market order but still facing issue. will do some research based on your posts. thx for hel
2023.06.18 01:06:16.473 2022.06.07 23:25:00 bid price132.629 ask price 132.631
2023.06.18 01:06:16.473 2022.06.07 23:25:00 Trade error code 10015
2023.06.18 01:06:16.474 2022.06.07 23:25:00 failed sell 0.09 USDJPY at market sl: 133.998 tp: 129.889 [Invalid price]
2023.06.18 01:06:16.474 2022.06.07 23:25:00 last error reported 4756
When you sell at market you use the current bid price not a different price.
2023.06.18 00:21:53.281 2022.06.07 23:25:00 bid price132.629 ask price132.631
2023.06.18 00:21:54.339 2022.06.07 23:25:00 failed sell limit 3.08 USDJPY at 132.628 sl: 132.671 tp: 132.542 [Invalid price]
A sell limit must be above the market by at least MODE_STOPLEVEL * _Point or SymbolInfoInteger(SYMBOL_TRADE_STOPS_LEVEL). Your sell price was below.
Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial
There is no need to create pending orders in code.
The pending has the slight advantage, A) you are closer to the top of the queue (filled quicker), B) there's no round trip network delay (filled quicker.)
Don't worry about it unless you're scalping M1 or trading news.
Humans can't watch the screen 24/=7, so they use pending orders; EAs can, so no need for pending orders, have it wait until the market reaches the trigger price and just open an order.
hey thanks both
working now after selling at market price