NexusFi: Find Your Edge


Home Menu

 





Trying to create an EA that will tell me every time the price moves by about 10 point


Discussion in Platforms and Indicators

Updated
    1. trending_up 748 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 1 posts
    2. attach_file 0 attachments




 
Search this Thread

Trying to create an EA that will tell me every time the price moves by about 10 point

  #1 (permalink)
ThomasM1
Cork Ireland
 
Posts: 1 since Nov 2019
Thanks Given: 0
Thanks Received: 0

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;
}

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Cheap historycal L1 data for stocks
Stocks and ETFs
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
REcommedations for programming help
Sierra Chart
Quant vue
Trading Reviews and Vendors
NexusFi Journal Challenge - May 2024
Feedback and Announcements
 




Last Updated on November 21, 2019


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts