[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 586
![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
Good afternoon, trying to figure out how to write an EA. I took the EA template from the article on mql4 website, added my own conditions to understand the debugging and functionality, entered the conditions for opening positions:
I have added my own conditions (or changed existing ones) to make sure the orders were executed by fakut.
or use the condition - if there are no open orders on the zero bar, it is OK to open:
see three posts above - analyse only formed bars from 1
But for that iMAOnArray(MyATR,0,PerB,0,MODE_SMA,1 ) and prescribed 1 at the end and Open[0] is not changed during the bar and I will need it.
but Asc and Bid change on every tick - so the condition can be triggered many times during a single bar
What about to make execution happen once, maybe replace them with High[0] and Low[0]? Or there are other commands, maybe the condition to execute inside the bar once?
I already wrote it above.
I've been reading, had fun on the fund before, now I want to try forex. In WelsLab on the fund this is easy to do via stop:
MyATR = SMA.Series((((High-Low)/Low), PerB)[i-1] ;
if (BuyAtStop(i, (Open[i] + Open[i]*MyATR), "") ;
Can't it be done in MetaTrader?
I've been reading, had fun on the fund before, now I want to try forex. In WelsLab on the fund this is easy to do via stop:
MyATR = SMA.Series((((High-Low)/Low), PerB)[i-1] ;
if (BuyAtStop(i, (Open[i] + Open[i]*MyATR), "") ;
Can't this be done in MetaTrader?
No, that won't work. only through analysis of order history. that's how our MQL is - it's not very good, but it has its own features :))) that's why most of useful functions are handwritten.
I don't mind, can I get a working example or a link?