Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 392
![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
in your piece of code, is the price channel channel_top and channel_bottom defined above? Where is the definition of a pin bar?
Reply
Artyom, you didn't read it carefully: the TS needs to open only at a pin bar breakout, respectively, if you prescribe a pin bar (small body and large shadows), the condition can be met
Vitaly, I was answering to this:
...and ignored all the ones before...
If all the ones that were before were pin bars, then how can you ignore them when they were current, were pin bars crossing the line?
How is the iCustom function handled in MT4? Please reply to those who know about it!
For example, in the strategy tester an Expert Advisor accesses the indicator at every tick.
When the function is called, the indicator is loaded into the memory, recalculates all values from zero bar to Bars and then returns the value at the required offset.
If I request the value of 1 bar on the first tick and the value of the second bar on the second tick, then my Expert Advisor will calculate the indicator twice on the entire history?
If the Expert Advisor accesses the indicator1, and it has iCustom to the indicator2. How many times will the indicator2 be recalculated when requesting the value of indicator1?
Maybe, the Strategy Tester and the MT4 terminal stores the indicator values on every bar, so that not to recalculate them at the repeated request?
It all depends on the realization of the indicator. If the calculation is correct, then the indicator calculates only the current bar - the others were calculated at (rates_total-prev_calculate)>1
how to average iMAOnArray over an array if there areEMPTY_VALUE values in the array ?
how to average iMAOnArray over an array if there areEMPTY_VALUE values in the array ?
I see! If at least one value in the averaging sample isEMPTY_VALUE, then the iMAOnArray value at that point is alsoEMPTY_VALUE.
Good day to you all. I am testing an EA. I am not going to trade with it, but only to check some regularity. The EA opens an order on every minute candlestick and if the order is closed on a SL, it opens another BUY order at close price on a SL.
The problem is... If several orders are closed on one tick and the last order is closed on a PI, the BUY order I need is not opened. This is because the program thinks that the last order was closed by a TP, not by a SL. Here is an example of such a situation
13:38:15.859 2008.01.02 15:01:46 Tester: stop loss #232 at 1.46566 (1.46560 / 1.46562)
13:38:15.859 2008.01.02 15:01:46 Tester: stop loss #233 at 1.46566 (1.46560 / 1.46562)
13:38:15.859 2008.01.02 15:01:46 Tester: take profit #302 at 1.46562 (1.46560 / 1.46562)
13:38:15.859 2008.01.02 15:02:00 MACD Sample EURUSD,M1: open #347 sell 0.10 EURUSD at 1.46570 sl: 1.46972 tp: 1.46372 ok
Could you please explain what language structure should be used to open a BUY order on one tick right after the SL order is closed on the same tick with the SL order.
Thank you.
Hello!
I've already racked my brains. How do I check if there is a certain price in the double array?
I wrote it like this for the test:
The script finds 11, 22, 33, 44 without any problems (the terminal has such orders). However, if the script processes the price of 45, for example, it still shows 3 (position of the price 44 in the array).
What I really need is a bool - if there is a price of the order being processed in the array, it should return true, if not, it should return false. But I haven't found such a function in the language yet.
Good afternoon. Can you tell me why the file is not being created and the data is not being written to:
Examine the Files folder carefully!!! Always write to the sandbox = File folder . Try it this way:
Examine the Files folder carefully!!! Always write to the sandbox = File folder . Try it like this:
VolC - I named the file that way. Isn't the file name needed?