Log in or register to download unlimited Forex robots!
Trying to create an EA that will tell me every time the price moves by
Trying to create an EA that will tell me every time the price moves by about 10 points
Hi
I’m fairly new to coding and especially to MQL4. I’ve tried the below code in a few different ways. What I am trying is,
Create a start price level, and if the Ask price is higher than this level, automatically create a new target level, which would be the current Ask price, plus 10 points (and for the first question to become disabled (in place of the new question) in order to stop getting infinite alerts when price is above. And now, if the price goes another 10 points higher, the alert will be triggered again, repeating the last steps. And the same for the opposite direction, so any time a level is hit, then a new target is put up above and below of 10 points.
I have some ideas, but I’m finding it difficult to implement the code, and may be missing a few functions or statements that are needed in MQL4.
Like for example, if the first level to check is above the start price level, then keep asking the question, but as soon as the Ask price goes above this level, stop asking the question and send an alert, but now start asking a new question for another 10 points higher than the ask price that triggered the alert.
So if someone can tell me what I need to get acquainted with here I would very much appreciate it. Below is one way I tried to do it, but I haven’t done anything much better than that.
Thanks
extern int AddPipp = 1000;
extern int SubtractPipp = 1000;
void OnTick()
{
double target = 27820;
if(Ask > target)
Alert(Ask);
target target + AddPipp*Point;
}
Why don't many people post their daily winning results?
MT4talk PRO members can Turn off MT4talk daily winning result post requirements for $49.99 / month. More info...
Latest profit posts from the Trade Executor EA users.
By using the MT4talk website, you automatically agree to the Forum Rules & Terms of Use, as well as the terms below.
Everything you see on the MT4talk website is created by its users, mainly the members of the MT4talk forum.
What is MT4talk?
MT4talk is an online Forex forum with over 5000 Forex robots and over 3000 Forex indicators uploaded by forum members in the last 10 years, available to download from forum posts. The Uploaded file does not come with support.
The website doesn't sell Forex robots and doesn't provide support for the ones you download. MT4talk offers a PRO membership, allowing you to download unlimited files from forum posts. Even though the site usually doesn't provide support for downloaded Forex robots, if you're new to Forex and need help, you can buy the MT4talk dedicated support membership from the MT4talk forum. The MT4talk Dedicated support subscription is only available for purchase for MT4talk PRO members.
The MT4talk Team also provides an Artificial Intelligence Forex robot called "MT4talk Forex AI Signal - Trade Executor EA" to PRO members. However, this Forex robot is only a bonus and is not included in the original PRO membership.
Updates for the Forex robots may be limited or nonexistent, depending on the creator. If you choose to download any Forex robot or setting file from the forum, you acknowledge that you are using it at your own risk. MT4talk PRO membership is a digital product. Therefore, after you complete the PRO membership purchase, there is no refund available!
We are conducting real-life tests on Forex robots to assess their performance. For certain robots, we may use a demo account to conduct tests, and for other Forex robots, we may use a real Forex account. It's essential to recognize that we are not financial advisors and cannot provide investment guidance. Our objective is to discover effective market analysis solutions through testing various strategies, which could be beneficial to our community.
CFTC RULE 4.41 – HYPOTHETICAL OR SIMULATED PERFORMANCE RESULTS HAVE CERTAIN LIMITATIONS. UNLIKE AN ACTUAL PERFORMANCE RECORD, SIMULATED RESULTS DO NOT REPRESENT ACTUAL TRADING. ALSO, SINCE THE TRADES HAVE NOT BEEN EXECUTED, THE RESULTS MAY HAVE UNDER-OR-OVER COMPENSATED FOR THE IMPACT, IF ANY, OF CERTAIN MARKET FACTORS, SUCH AS LACK OF LIQUIDITY. SIMULATED TRADING PROGRAMS, IN GENERAL, ARE ALSO SUBJECT TO THE FACT THAT THEY ARE DESIGNED WITH THE BENEFIT OF HINDSIGHT. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFIT OR LOSSES SIMILAR TO THOSE SHOWN.
Disclaimer - No representation is being made that any Forex account will or is likely to achieve profits or losses similar to those shown on backtests in this forum. In fact, there are frequently sharp differences between hypothetical performance results and the actual results subsequently achieved by any particular trading program. Hypothetical trading does not involve financial risk, and no hypothetical trading record can completely account for the impact of financial risk in actual trading. All information on this forum is for educational purposes only and is not intended to provide financial advice. Any statements posted by forum members or the MT4talk EA Tester Team about profits or income expressed or implied, do not represent a guarantee. Your actual trading may result in losses as no trading system is guaranteed. You accept full responsibilities for your actions, trades, profit or loss, and agree to hold the MT4talk team and forum members of this information harmless in any and all ways.
Affiliates Disclaimer - The website may have links to partner websites, and if you sign up and trade through these links, we will receive a commission. Our affiliate partners are FXOpen, FBS, LQDFX, and MyForexVPS.
Copyright MT4talk.com Forum Rules - Privacy Policy.