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
He does not understand.
I understand😄
I wrote why I think so. I'm still writing for MT4, but it's been a few years since I last selected an order before closing. Because at the time of closing the order I already have all the information ready.
Market order class of one of my recent advisors:
Such classes vary greatly depending on the information required. For example, this could be a structure that completely calculates itself in the constructor, in which case, when collecting information about orders, I just need to select an order and change the size of the structure array.
Therefore, for me personally, using OrderSelect + OrderClosePrice makes no sense at all, moreover, it would work worse in terms of performance.
William Roeder will throw stones at me for normalizing order prices😄
But this is done deliberately so that I can use these prices in comparisons without thinking about the precision of the double type
This is correct
SL and TP must be normalized.
And this already looks quite cumbersome. So personally I wouldn't use the ternary operator in the case you showed. But this is just my subjective opinion. Do as you wish.
So, it always good to use Ask/Bid instead of OrderClosePrice()?
Use what you like. I posted my opinion here, but I do not impose it on anyone
When closing several positions from an array, you may encounter a situation where some position no longer exists - it was closed at TP/SL/MC, for example.
An absolutely neutral event that does not affect anything
An absolutely neutral event that does not affect anything
Unlike this one on MT5, for example.
This is one of the reasons why switching to MT5 is not economically feasible for me as a freelancer. MT5 has a number of nuances that greatly increase the time spent on developing reliable advisors.
For MT4, I can somehow compete in terms of cost of work with the guys who write unreliable, low-quality advisors for a couple of dollars. That is, thanks to my own developments/templates, I can offer the development of high-quality advisors at the price of a low-quality advisor.
I can offer the development of high-quality advisors at the price of a low-quality advisor
I cannot do this for MT5 because developing a reliable advisor on MT5 will take much more time than its counterpart on MT4. Customers have dozens of offers from developers for a couple of dollars. It's very hard to compete with this. Of course, the quality of advisors for a couple of dollars is usually very low, but customers don’t understand this.
[if the moderators want to delete my last couple of posts, then I don’t mind]
Vladislav Boyko #: SL and TP must be normalized.
SL/TP (stops) need to be normalized to tick size (not Point) — code fails on non-currencies.
On 5Digit Broker Stops are only allowed to be placed on full pip values. How to find out in mql? - MQL4 programming forum #10 (2011)
And abide by the limits Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial and that requires understanding floating point equality Can price != price ? - MQL4 programming forum (2012)
SL/TP (stops) need to be normalized to tick size (not Point) — code fails on non-currencies.
On 5Digit Broker Stops are only allowed to be placed on full pip values. How to find out in mql? - MQL4 programming forum #10 (2011)
And abide by the limits Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial and that requires understanding floating point equality Can price != price ? - MQL4 programming forum (2012)
I've never had a problem with SL/TP not being normalized to tick size. I wrote a small script to find the desired symbol and found it (metaquotes demo).
Tomorrow (when the market opens) I will try to place SL, TP and pending orders “within” the tick size