![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
Yes, sort of like this, if you consider that the indicator name is hilo.mq4:
Small problem. The adviser on the indicator works. But.... Only with implementation of short trades!
i.e. at buffer number=1 and values on zero and first bar
the condition to sell works flawlessly.
But the Expert Advisor does not want to buy! I do not understand what is wrong! I think I have set the condition correctly. Buffer number = 0.
Not buying! Or it buys very rarely and from "the light"!
Although the lines of the indicator on the visual mode chart seems to be built correctly!
What can be the problem here?
Yes, sort of like this, if you consider that the indicator name is hilo.mq4:
Small problem. The adviser on the indicator works. But.... Only with implementation of short trades!
i.e. at buffer number=1 and values on zero and first bar
the condition to sell works flawlessly.
But the Expert Advisor does not want to buy! I do not understand what is wrong! I think I have set the condition correctly. Buffer number = 0.
Does not buy! Or it buys very rarely and from "the light"!
Although the lines of the indicator on the visual mode chart seems to be built correctly!
What may be the problem here?
I'm interested in this question too)).
Working with the custom indicator I noticed that:
Working with the custom indicator I noticed that:
In the first case, there is a conversion to the target int type before the assignment operation. Therefore, the comparison condition works correctly.
For the second case we need to round floating point numbers to a specified accuracy before comparison using the
Sorry...
My above example is based on a mistake.
Which was that the assignment was on the retracement price by the FATLs indicator.
I did not notice it on EURUSD and mistook "arrows appearing" for bulls 0 and 1
However, this variant corrected the situation:
Good afternoon, everyone!
Please advise.
Suppose I have a slow MA and a fast MA crossed on the chart. On the first bar.
Let it then passed a few more bars.
How can I determine on what bar the last МА were crossed?
-----------------------------
I cannot even think - how should I approach the problem?
Suppose I have a slow MA and a fast MA crossing on the chart. On the first bar.
Let then some more bars have passed.
How can I determine on which bar in the past the last crossing of the given MA occurred?
I need to know on the current bar.
How many bars have passed since the last crossing of the two bars - MA_1 and MA_2.
How to arrange a loop like this?
if (MA_1>MA_2) {
I need to know on the current bar.
How many bars have passed since the last crossing of the two MA_1 MA_2.
How do I do this cycle?