I don't understand where iCustom comes into this, perhaps I'm misunderstanding.
But the reason you might be getting multiple crosses where there should be one is that when you measure bar '0' you are measuring the current bar which is still forming. This means that the value of the MA changes as the price changes. As price hovers in a small range right the cross level, it is going to go back and forth repeatedly thereby triggering one cross then another and so on.
This might be the answer you're looking for.
But the reason you might be getting multiple crosses where there should be one is that when you measure bar '0' you are measuring the current bar which is still forming. This means that the value of the MA changes as the price changes. As price hovers in a small range right the cross level, it is going to go back and forth repeatedly thereby triggering one cross then another and so on.
This might be the answer you're looking for.
![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
Where: LMA is the long moving average
LMP is the long moving period , 1, is one period back
Price_close is ema calculated on the close of the period, 0, is current period
This is what I want to happen but I am getting multiple crosses when there should only be one cross if it has happened in the past.
Any help would be appreciated
Kevin