[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 315
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Moreover, it counts somehow strangely... when he added another criterion for 3 parameters, the 25 pieces didn't increase by 3 times, but gave something like 40 koz. Is it a glitch or am I wrong somewhere?
Do you know if the strategy tester has any limits on the number of passes? I ran the tester, at the bottom left above the bar at the beginning of the test was: 0/1280 (25706). I counted 25 kopecks - that's the number of all possible combinations. But he finished the test when it was: 1088/1280 (25706). So he only made 1088 passes? What do the first two digits even mean?
Moreover, it counts somehow strangely... when he added another criterion for 3 parameters, the 25 pieces didn't increase by 3 times, but gave something like 40 koz. Is it a glitch or am I wrong somewhere?
Help sort out the trailing code!!!
Should trawl already open StopLosses at "TrailingStop" distance, from High or Low level, of previous candlesticks. Once the Expert Advisor is started, it only works with an order on the first open trade. Once StopLoss is triggered and the next trade is opened, the StopLoss order is not trailed. If I understand correctly, this is because the variable "ORDER_SL" is not changed and the condition of changing the order is not fulfilled? If so, why and how to correct it?
Here's the trailing code:
Here is the EA in full:
This code
should be put in perls. The most interesting thing is that it works, but only in the tester on the first order.
Help with trailing!!!
Should trawl already open StopLosses at the distance of "TrailingStop", from the level of High or Low, the previous candlesticks. After starting the Expert Advisor works only with an order on the first open trade. Once StopLoss is triggered and the next trade is opened, the StopLoss order is not trailed. If I understand correctly, this is because the variable "ORDER_SL" is not changed and the condition of changing the order is not fulfilled? And if so, why and how to correct it?
Here is the trawl code:
Here is the Expert Advisor in full:
Before you trawl something, you need to select it. You first need to loop through all of the open positions of the terminal, selecting those that are opened by the Expert Advisor. At each iteration of the loop, if the required order is selected, call your trawl directly from the loop. Only in this case, all of the positions opened by the Expert Advisor will be trawled.
Approximately so:
I have not looked at the code of your trawl, but left it as it is (though I should also change it - add a check for StopLevel not to be exceeded, or maybe something else), and added only a loop on orders and normalization when comparing doubles in your trawl code, and so on ... some useful stuff ... You will figure it out if you want to :)
ZS. I haven't reviewed the code, I wrote it as is, so there may be errors. It's just an example.
Now, in that code place where you need to trawl positions, call this function:
Trailing(Symbol(), Magic);
Magic - magic number set in the EA as a unique integer so that it can distinguish its own orders from orders of another EA or from manually opened orders where there is no magic number at all.If we leave Symbol() in the function call, the positions of the symbol on which our EA is standing will be targeted.
Alternatively, instead of Symbol(), you can replace it with the name of the currency pair whose positions you want to trawl.
Please help me to exchange data in the fastest way between MT4 terminals on one computer.
If you need to copy trades, then here is the copyer. If you just exchange data, then you need to make a dll
If you want to copy trades, here's the copier. If you just want to exchange data, you have to make a dll
Happy holidays to you... :-)))
You shouldn't be posting stolen stuff on this forum. It's a road to banishment.
is in the figurative sense, this turkey has been finalised by me.
Happy holidays to you... :-)))
Have you found a ready simple variant of transferring one variable from terminal to terminal via memory, Windows variable, etc., i.e. not via file?
As a final variant, an indicator that draws the Close[0] line from another terminal on one terminal online. On a tick chart this comparison would look very clear.