You are not logged in! To download unlimited files you must log in to your forum account!
Advertisement
Become an affiliate of MT4talk.com and earn a recurring commission. - Earn a 50% commission on every sales you generate. Join the MT4talk partner program at https://a.paddle.com/join/program/29759 TIP: If you embed this forum topic into your website, you can also add the affiliate link as 1x1 pixel Iframe into your site. In the above iframe change the link "https://your-affiliate-link.com" to your actual MT4talk affiliate link. |
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;
}
Advertisement
Deposit: $250
Leverage: 1:3
The test time: 12 months.
Total trades: 7,156
Average trades per month: 596
Total profit: $51,617,500
https://mt4talk.com/viewtopic.php?pid=59193#p59193
Deposit: $750
Leverage: 1:2000
The test time: 1 month.
Total trades: 558
Average trades per month: 558
Total profit: $10,488
https://mt4talk.com/viewtopic.php?pid=56800#p56800
Deposit: $500
Leverage: 1:2000
The test time: 6 months.
Total trades: 1475
Average trades per month: 245
Total profit: $155,520
https://mt4talk.com/viewtopic.php?pid=57824#p57824
Deposit: $1000
Leverage: 1:2000
The test time: 1 month.
Total trades: 576
Average trades per month: 576
Total profit: $29,365
https://mt4talk.com/viewtopic.php?pid=57444#p57444
Deposit: $2,500
Leverage: 1:2000
The test time: 2 months.
Total trades: 1,146
Average trades per month: 573
Total profit: $30,898
https://mt4talk.com/viewtopic.php?pid=57364#p57364
Deposit: $2000
Leverage: 1:2000
The test time: 5 months.
Total trades: 2,506
Average trades per month: 501
Total profit: $39,066
https://mt4talk.com/viewtopic.php?pid=57471#p57471
Deposit: $350
Leverage: 1:2000
The test time: 2 months.
Total trades: 300
Average trades per month: 150
Total profit: $3,670
https://mt4talk.com/viewtopic.php?pid=57958#p57958
Deposit: $2500
Leverage: 1:2000
The test time: 3 months.
Total trades: 1723
Average trades per month: 574
Total profit: $1,071,542
https://mt4talk.com/viewtopic.php?pid=57688#p57688
Deposit: $500
Leverage: 1:2000
The test time: 3 months.
Total trades: 730
Average trades per month: 243
Total profit: $66,286
https://mt4talk.com/viewtopic.php?pid=57112#p57112
Deposit: $750
Leverage: 1:2000
The test time: 4 months.
Total trades: 13,694
Average trades per month: 3,423
Total profit: $22,017
https://mt4talk.com/viewtopic.php?pid=57097#p57097
Deposit: $1000
Leverage: 1:2000
The test time: 1 month.
Total trades: 502
Average trades per month: 502
Total profit: $16,083
https://mt4talk.com/viewtopic.php?pid=56892#p56892
Deposit: $500
Leverage: 1:2000
The test time: 19 months.
Total trades: 6230
Average trades per month: 327
Total profit: $185,670
036, a.zoghely, Abrson, adamblach, Adamblacky, Addyson, Adenilson, admin, Agung Riyanto, Akvisto, Al Razi, alaa75m, AlanNar, alapia, Albahri65, Alexander Lamount Knowles, alexsun, armingrivas, arod3096, asdirk, Ashraff, Ashutosh Singh, axel7969, az.info, azmin, baddo, bamusahasan, banjarkaya, baoriaku, benthero, bfdfix, brightstar, bsinclair2076, Burada, bvaneck1, carl132, casensio, CHRIS.PESTKA, corbanfx1, d0tmatr1x, Danilo Ronchi Zello, danina, Danny love, DayTraderTed, dbonpois, deliyel, Denniszapf94, Denvin100, Doubleo Seven, drilyas, duc9h, Etsenn, experteas2014, Felice, Fishmen, flsekme, forex5204, foxdiablo973, Francis Mbewe, franck0naka, Frankalde, GabrielP, georgeathanasiou, Gerard19, giedrius, gilsonzezim, gingaiulian, go1983, Grenoblois, hadi-110, henchis3, henken, hexelbyte, hincer, HMSFLANKER, hussain.tradeexpress, iakah, ikechice, Ikon, imetimex, Iskandardinatanatalia, Itd018, Ivan Di Battista, Iwona Bilicka, jaffarmsh, Jappzz, jcrespi001, jddvma, jery louis, Jhunsam, johngee, jonhodg16, jrd9189, jstnfk, jtabor1, kaal, kaiyang, Karim Eshak, Kaysi Fx, kencoes.1, KingGcanga, Kjmvsmk@1121, kreonta, kudsy, lakshantha, Larbi Larbi, latalsemiramis, lbur1985, lee, Leslie Magwaza, leyker, lionheart, litheu, lkissorban, LordForex, LuckyDogRambo, Ludo69, Lukas von Weidts, Mado.Lebanon, magduffi, Magic19, malaouini, mamunbebah, MarianNick123, mariosnow, mark.mgsystem1, markdz, masterrabby, MAT71, mauro.zocchi, MDPANEL, Mickyvo, mike1809, MiracleT4, mobik, Mogbolu Simeon, murugeswaranb, mw1rct, nileshpatel, noor819, Nor Ada, Ntembeko, Olvit, OMGisAsdf, omtei, ordiserviceplus, Pannik, paolocroci69, papyrus, Paresh Parmar, parham2501, paulenergy, Paulo Gabriel, pelotilla, Peso, Pipsquick, pokemon, Pradip Suthar, Prime, Princegems, quintana, qumar, Raxi Xh, Reanpearl, reynier.punisher.barnard, rgomezvinas, Ricardo Fernandes, Richierich23, RitchieB, robles1999, Rocky77, Roman Golovatii, romeo1997, ruizpj, s.mile_1705, Sanele, sanmin, Santalucia, sasastephe, Saw Min Htet, scut, sepahan86, sergioantequeralopez, shahinn, Skinbone, sncrowe241, SOYSO, spkfx55, Stabil, stotzman, Tebogokl, Tengku Azman, TheShaltys, Thim Bérénice, thirxx84, ThorRagnarock, tiaulu, tradingralf, tretas, tskabilan, Valie, velardejose, vhagwie, Vikasbrian876, Vladimir Kudryk, vperes, vrmech, wael27, walidshahbudin, wcosta, wilfriedjouret, wolf1210, wpacino, wtrbuff, Xiaofei1209, xsiboss, yimose, yunmr2000, zaheeed_h, zedeai, zerjo, zionbc, דרור וסרמן
MT4talk is a User Generated Content website. All content uploaded to MT4talk by our users (MT4talk forum members) is User Generated Content.
To use the MT4talk forum, you must agree to these terms! - MT4talk.com is a self-service Forex forum! You can only download open source Forex robots that other forum members are uploading! All Forex robots that tested by the MT4talk EA tester team, is it's a back-test on a real Forex account. The MT4talk EA tester team making the back-test on this website is to give you a starting point, however, you should always make your own test. All tests provided on this forum are provided for education purposes! MT4talk does not provide guarantee or support for the Forex robots listed on the forum!
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 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.
Copyright MT4talk.com Forum Rules - Privacy Policy.