[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 325
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
Eh, as the saying goes: "Study, student" (c).
Delete unnecessary (comment it out)
Thank you very much! I'm a lifelong learner, too! And in general, learning is more interesting than working. I'm going to try to adjust it now, I don't want to change the order in the code. At any time I change or add conditions depending on the changes in the market behavior. All the best to you and good night!
A piece of code which opens an order and sets stop loss and take profit
terminal generates the following errors: EURUSD,M30: OrderSend error 130
EURUSD,M30: invalid ticket for OrderModify function
EURUSD,M30: OrderModify error 4051
EURUSD,M30: OrderSend failed with error #4051 bid:1.23674000 ask:1.23683000 Open:1.23674000 SL:1.2423 TP:1.2283 MODE_STOPLEVEL:0.00000000 LOT:0.01000000
What is the problem can you tell?
RMX13, everyone has the same problem. To avoid error 130, you need to normalise all calculations with prices, lots and conditions, especially close to prices taking into account spread, stoplevel and freezevel, and slippage, which should be increased depending on volatility. Just asc doesn't need to be normalized, but if you add something to it, it needs to be with Digits, and lots with 2 (cents), etc. throughout the code, and of course error handling in all trading functions, so as not to bother the DC for nothing. Good luck!
See in Doc: OrderSend(Everything must match the contents in the set order)! That's why there are errors(:((
Guys, there's an interesting topic on this forum:Forum Navigator and Answers to Frequently Asked Questions. Highly recommended reading!
There is an interesting table there :
We all worked hard to collect and clean it up.
Here you go: Useful features from KimIV It's got everything you need, for almost everything.
I wonder if you've ever noticed it.
Dear FAQ! I use this if possible, but it does not suit me because of its immutability and, of course, my inexperience. For breaking even and further trawling I use dynamic methods with self-changing parameters, that's why I don't set tralestop or std. I also use stoploss if the connection is interrupted. That's why sometimes the slose from Mashka is delayed and SL is triggered. Errors are very rare because of the lack of "thickness"(granit77) of the EA, which I am constantly improving and adapting to the ever-changing market.
Thank you for your thoughtfulness!
I have made it and it has worked in my environment without errors in the tester. I will try it again tomorrow on Real.
I had to separate Close in a separate block. Thanks again!
Good morning!
As they say, it's better in the morning! All I needed was one line to check for orders that have just been closed:
I've merged everything and hope there are no more mistakes for that reason! Live and learn! All the best, including profit positivo!RMX13, everyone has the same problem. To avoid error 130, you need to normalise all calculations with prices, lots and conditions, especially close to prices taking into account spread, stoplevel and freezevel, and slippage, which should be increased depending on volatility. Just asc doesn't need to be normalized, but if you add something to it, it needs to be with Digits, and lots with 2 (cents), etc. throughout the code, and of course error handling in all trading functions, so as not to bother the DC for nothing. Good luck!
See in Doc: OrderSend(Everything must match the contents in the set order)! That's why there are errors(:((
Thank you it is understandable.
And how to eliminate this " invalid ticket for OrderModify function "?
Can you explain me, please, where to start, what to do, what are the pitfalls.........or a link to read for beginners in forex?
Thank you, that's clear.
But how do I fix this " invalid ticket for OrderModify function "?
To do this, I need to run the same Select and in the same order before specifying the order type, as done in my code above, and then specify OrderTicket() in all trading functions.
Can you explain me, please, where to start, what to do, what are the pitfalls.........or a link to read for beginners in forex?
If you are interested in trading, you have to download the Forex primer (you can find it in almost any dealing centre (DC) in the education section). If you are interested in Forex programming, then on top of every page of this site there is a link to the tutorial and documentation (reference book). But about the pitfalls you have to ask here for each case separately - for this stone must be encountered. Giving information without the context of personal practice is pointless: you will forget it immediately.
Can you explain me, please, where to start, what to do, what are the pitfalls.........or a link to read for beginners in forex?
See above for all the blue recommended by the moderator! All very important to read and assimilate.