Norza Hekmily :
Hi Norza,
If you want to detect the crossing of the price with an IMA without using iClose() or iOpen(), you can work directly with the values of the iMA and the current price (Bid/Ask).
A simple way is to check if there is a sign change in the difference between the price and the iMA:
- If (Current Price - Current iMA) and (Previous Price - Previous iMA) have opposite signs, it means that there was a crossover.
Another more detailed option is to compare the iMA in two consecutive periods and check if the price has crossed over:
- Compare the current price with the current iMA.
- Compare the price of the previous candle with the iMA at that time.

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
ah... I been trying to figure out a way to identify action price crossover without using any of "iclose(), iopen()". The reason is because using candle property, it use specific candle, otherwise what I try to make its, to make the logic know that price did cross ima in history without specifically choosing which past candle history that did cross ima. To be honest Im confuse too and perhaps actually the correct way is to use candle property to identify it nonetheless. But I cant find any online source at all. The thing that I notice with my EA is that sometime price miss out on condition because of candle is further back even though it should be valid set up. Man if any senior programmer know the way around it or better option, please help me!