I am trying to develop an EA now just for educational purposes. The idea is simple. It detects candle spike and put an order (buy or sell) with a TP and SL. Ihe idea is based mainly on simple candle pattern.
This picture would help to get the idea. Here is the code under but still not working. I am not sure why?
fixed some embarrassing mistakes. but not working yet. I think it might be the signal logic is bad .. more specifically, the way i am looking for previous buys or sells.
You can only call FindNewBaronce per tick. Every subsequent call always returns false. That is why I recommend that that is never placed in a function.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Try this:
Not compiled or tested
worked great... Thank you so much
Hi, I want to develop EA in MT4, I have made some EA before and have experience with C++.
Now, since MQL4 supports OOP which I'm more comfortable than procedural language, is it wise to learn new MQL4 language which is adapted from MQL5 ?
Unfortunately its still lack of tutorial although the documentation is there.
Continuing on my programming learning endeavor,
I am trying to develop an EA now just for educational purposes. The idea is simple. It detects candle spike and put an order (buy or sell) with a TP and SL. Ihe idea is based mainly on simple candle pattern.
This picture would help to get the idea. Here is the code under but still not working. I am not sure why?
//I wanted here to make sure that EA opens only one buy " or /and " one sell at any time.// However, i am thinking what would happen if there is no orders at all. How this could workYou can try something like
Also, the variables absHighToClose5 etc are not assigned values in OnTick so will not change from when the EA is started. Is that what you want?
Thank you so much.. It was a new info to know about this kind of variables. I have done the modifications. Buy orders did work but SELL did not.
In the log, it says there is sell signal true but EA did not open. What i can say is "Programming is really fun". :)