I am wanting to write an Expert Advisor, but I do not know if the commands I require are even possible with mql4... Is it possible to write an EA with the following stipulations:
1) Based completely on how price moves relative to itself, determining thresholds based solely on the range of highs and lows and retracements (if price has retraced "x" pips, open and closing orders are based on arithmetic based on price (maybe I can input the initial "ABC's"??)
...then, if certain thresholds are attained...
2) Then some kind of "market if touched" command (based on LAST price, or tick - the white block on the right of the screen, not Bid or Ask - just current price.)
3) Calculate lots based on account size.
Are any of these possible with MQL4?
Thanks, GumRai. If you don't mind my asking, how did you learn to code? I'm aware of the online book, and I'm a little ways through it, but it is looking doubtful that I will find what I'm looking for in there. Also, do you know what the going rate would be to freelance a really simple snippet of code like "if price (not Bid, not Ask, but last tick) goes up 10 pips, then sell, then close with 5 pip profit or stop"? Is that an easy code? If I were able to study a code like that, boy oh boy, that would be amazing for me and what I'm trying to accomplish.
I read the book and also went through old topics on this forum as there are thousands of snippets of code here. It is important to accept that you will not be able to just jump in and write a complicated code straight away. You have to learn the basics first and that takes time.
I believe that the most difficult thing is being precise and logical.
"if price (not Bid, not Ask, but last tick) goes up 10 pips......
There are only 2 current prices per tick, Bid and Ask, so your statement is illogical.
goes up 10 pips from what? your statement is not precise.
So, if I pull up the Tick Chart for EURUSD, it would show one price - the last price, not the bid and ask... Same for the little white block to the far right of the chart that shows the last trade price - can mql not pull from that?
...and yes, I omitted a reference point for that hypothetical code... let's say, from the moment you drop the EA on the chart - if it goes up 10 sell, down 10 buy, and TP and SL both at 5 pips. Is that difficult code?
No, it is not difficult code. Try it and see.
But then you have to decide what to do once an order is opened
a simple EA opens an order if price is higher than x, well next tick price may well still be higher than x and it may continue to open orders every tick while price is higher than x. So there has to be additional coding to prevent unlimited opening of orders.
To add comments, please log in or register