You didn't specify a language.
And what have you tried so far ?
- freecbc3: i'm trying to code … any help pleaseHelp you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
No free help 2017.04.21Or pay someone. Top of every page is the link Freelance.
Hiring to write script - General - MQL5 programming forum 2018.05.12 - freecbc3: i need it ..mq4 for mt4
Why did you post your MT4 question in the Root / MT5 General section instead of the MQL4 section, (bottom of the Root page?)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Next time post in the correct place. The moderators will likely move this thread there soon.
- Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button)
and state the nature of your problem.
No free help 2017.04.21Or pay someone. Top of every page is the link Freelance.
Hiring to write script - General - MQL5 programming forum 2018.05.12 -
Why did you post your MT4 question in the Root / MT5 General section instead of the MQL4 section, (bottom of the Root page?)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Next time post in the correct place. The moderators will likely move this thread there soon.
i am sry wiliam i am new here
i hope some one can code it
hello,
i'm trying to code an indicator derived a alert on next candle as previous candle
mean if current candle in green to send a alert as buy in next candle
and if last candle is red to send a sell in next candle
any help please
if (iClose(NULL,0,i+1) > iOpen(NULL,0,i+1)) Alert("Buy"); else if (iClose(NULL,0,i+1) < iOpen(NULL,0,i+1)) Alert("Sell");
first of all thanks you Jean Francois
i just need it to save in file .mq4 and its should work ?
as i try it and didnt work
- freecbc3: its should work ? as i try it and didnt workMT4: Learn to code it.
MT5: Begin learning to code it.
If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into yours. - freecbc3: i hope some one can code itor pay (Freelance) someone to code it.
Hiring to write script - General - MQL5 programming forum
//+------------------------------------------------------------------+ //| alert.mq4 | //| freecbc3 | //| https://www.mql5.com/en/forum/341397 | //+------------------------------------------------------------------+ #property copyright "freecbc3" #property link "https://www.mql5.com/en/forum/341397" #property version "1.00" #property strict //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { if (iClose(NULL,0,1) > iOpen(NULL,0,1)) Alert("Buy"); else if (iClose(NULL,0,1) < iOpen(NULL,0,1)) Alert("Sell"); } //+------------------------------------------------------------------+
//+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { static datetime barTime=0; if(barTime!=Time[0]) { barTime=Time[0]; if(iClose(NULL,0,1) > iOpen(NULL,0,1)) Alert("Buy"); else if(iClose(NULL,0,1) < iOpen(NULL,0,1)) Alert("Sell"); } } //+------------------------------------------------------------------+
Checking for a new bar will avoid getting alerts every tick.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
hello,
i'm trying to code an indicator derived a alert on next candle as previous candle
mean if current candle in green to send a alert as buy in next candle
and if last candle is red to send a sell in next candle
any help please