sk2you:
Hello All,
I am trying to create an EA in that if a bar cross 200 SMA line in either direction, Then based on cross I want to open a trade.
But I am not able to do that, Kindly check my code;
As you can see the blue line, I want to open a trade only on that time, But I am not able to fix this, Please help.
// Code
I cannot understand why you have two SMAs(fast and slow) with different shifts and the same period. As you just need to check the bar ohlc with respect to SMA.
![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
Hello All,
I am trying to create an EA in that if a bar cross 200 SMA line in either direction, Then based on cross I want to open a trade.
But I am not able to do that, Kindly check my code;
As you can see the blue line, I want to open a trade only on that time, But I am not able to fix this, Please help.
// Code