[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 174
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
The question is no longer how to write the code, but at the level of an idea - is it possible to avoid multiple loops,
which puts a lot of load on the processor. For example, there was an idea to track the number of open STOP orders - if it has decreased by one, but the order has not been deleted => open a market order =>
its open time and type should be placed in an array. Something like this.
Any ideas are welcome.
Only duplicate all market order properties in arrays and compare them with current market orders. Compare them by ticket and if there is no match by order type, it means that the pending order has triggered, if it is not found in the array, it has gone into history, etc.
May come in handy https://www.mql5.com/ru/code/9366
Hello.
I'm really asking for code comparing the last two fractals (either up or down).
For me, it is still a wilderness.
Thanks in advance.
HOW TO CALCULATE THE NUMBER OF PROFITABLE LONG POSITIONS AND SEPARATELY THE NUMBER OF PROFITABLE SHORT POSITIONS IN THE PROCESS OF WORKING OF AN EA?
The strategy is as follows: if the number of profitable long positions since the start of the EA (or better, over the entire account history) is greater than the number of short positions, then only long positions should be allowed to be opened. And vice versa.
It is clear how to count these deals, if they are closed by the Expert Advisor: Close - Count. But if a position is closed by TP or SL, then ... ?
Maybe someone has a ready code of the function?
Only duplicate all properties of market orders in arrays and compare them with current market orders. Compare by ticket, if there is a mismatch by order type, it means that the pending order has triggered, if it is not found in the array, it means that it has gone into history, etc.
May be useful https://www.mql5.com/ru/code/9366
Thank you!
Hello.
I'm really asking for code comparing the last two fractals (either up or down).
For me, it is still a wilderness.
Thanks in advance.
In the simple case, something like:
Actually it's nonsense to ask such questions to an expert writer :) It turns out that you are not mature enough to be a beginner, so if you want to check if the calculated stops and takes are close to the open price of the order, you will probably learn nothing at all.
Why not... ))) Advice is good )))) Only everything has been tested a long time ago! Takes and stops greater than the minimum allowable values ... And everything works great in the tester! But in "live" mode it doesn't want to open positions! Maybe, dear ROGER, I'm not mature enough to be a beginner yet ))))) But you should at least look at the code I wrote - if it's not too much trouble... Maybe you'll find a bug there...
I had such an issue with one brokerage company. It turned out that I had to open an order with TP=0 and SL=0, and then use OrderModify() to set the required levels. Otherwise, the error "Stops are too close" was shown all the time.
I did not find an answer in the search
how can i see from the script which indicators are on the chart, what parameters and indicators, in which subwindows they are located?
thanks