My desired changes:
1) only concerned with Current Bar Tick Data.
2) no high/low lines and no previous bars.
3) Current Bar makes new high or new low then audio alert,
a) different short/quick audio alert for new high and new low,
b) new high alert can be turned off/on,
c) new low alert can be turned off/on.
4) Continuous example: Audio alert triggers for new high only once,
then next audio alert when new low only once,
until next new high alert goes off.
5) Place a small up arrow (lime) above price bar for a new high and
place a small down arrow (red) below price bar for a new low.
6) Could like a week of arrow history always show on chart even
after program has been closed?
7) Please provide source code for possible additional alert parameters at a later date.
Thanks, Mark
//+------------------------------------------------------------------+
//| RecentHighLowAlert.mq5 |
//+------------------------------------------------------------------+
#property version "1.01"
#property description "Draws lines on the High/Low of the recent N bars."
#property description "Alerts when the Bid price of the current bar crosses previous High/Low."
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_plots 2
#property indicator_color1 clrDodgerBlue
#property indicator_type1 DRAW_LINE
#property indicator_label1 "High"
#property indicator_color2 clrYellow
#property indicator_type2 DRAW_LINE
#property indicator_label2 "Low"
#define HIGH 1
#define LOW 0
enum enum_candle_to_check
{
Current,
Previous
};
input int N = 20;
input bool EnableNativeAlerts = false;
input bool EnableEmailAlerts = false;
input bool EnablePushAlerts = false;
input enum_candle_to_check TriggerCandle = Previous;
double HighBuf[];
double LowBuf[];
datetime LastHighAlert = D'1970.01.01';
datetime LastLowAlert = D'1970.01.01';
void OnInit()
{
PlotIndexSetInteger(0, PLOT_DRAW_BEGIN, N);
PlotIndexSetInteger(1, PLOT_DRAW_BEGIN, N);
SetIndexBuffer(0, HighBuf, INDICATOR_DATA);
SetIndexBuffer(1, LowBuf, INDICATOR_DATA);
}
int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime &Time[],
const double &open[],
const double &High[],
const double &Low[],
const double &close[],
const long &tick_volume[],
const long &volume[],
const int &spread[])
{
if (rates_total <= N) return 0;
// Skip calculated bars
int start = prev_calculated - 1;
// First run
if (start < N) start = N;
for (int i = start; i < rates_total; i++)
{
HighBuf[i] = High[ArrayMaximum(High, i - N + 1, N)];
LowBuf[i] = Low[ArrayMinimum(Low, i - N + 1, N)];
}
double Bid = SymbolInfoDouble(_Symbol, SYMBOL_BID);
if ((Bid > HighBuf[rates_total - 1 - TriggerCandle]) && (LastHighAlert != Time[rates_total - 1])) SendAlert(HIGH, HighBuf[rates_total - 1 - TriggerCandle], Time[rates_total - 1]);
else if ((Bid < LowBuf[rates_total - 1 - TriggerCandle]) && (LastLowAlert != Time[rates_total - 1])) SendAlert(LOW, LowBuf[rates_total - 1 - TriggerCandle], Time[rates_total - 1]);
return rates_total;
}
//+------------------------------------------------------------------+
//| Issues alerts and remembers the last sent alert time. |
//+------------------------------------------------------------------+
void SendAlert(int direction, double price, datetime time)
{
string alert = "Local ";
string subject;
if (direction == HIGH)
{
alert = alert + "high";
subject = "High broken @ " + Symbol() + " - " + StringSubstr(EnumToString((ENUM_TIMEFRAMES)Period()), 7);
LastHighAlert = time;
}
else if (direction == LOW)
{
alert = alert + "low";
subject = "Low broken @ " + Symbol() + " - " + StringSubstr(EnumToString((ENUM_TIMEFRAMES)Period()), 7);
LastLowAlert = time;
}
alert = alert + " broken at " + DoubleToString(price, _Digits) + ".";
if (EnableNativeAlerts) Alert(alert);
if (EnableEmailAlerts) SendMail(subject, TimeToString(TimeCurrent(), TIME_DATE | TIME_SECONDS) + " " + alert);
if (EnablePushAlerts) SendNotification(subject + " @ " + DoubleToString(price, _Digits));
}
//+------------------------------------------------------------------+
Commandes similaires
Title: Custom M5 Gold (XAUUSD Cent) Scalper EA with Daily Profit Target and Strict Risk Control 1. OVERVIEW & OBJECTIVE We need an Expert Advisor (EA) developed for MT4 and MT5 to trade XAU/USD Cent (XAUUSDc on HFM / HF Markets). The EA must operate fully autonomously on M5 charts, targeting micro-pips (3 to 5 cent movements) per trade. The core philosophy is "set-and-forget" with absolute risk protection to prevent
Hello! I am looking for an experienced MT5 developer to build a MetaTrader 5 Expert Advisor (EA) base on a single EMA for trading Gold (XAUUSD) On Prop Firm and a live account. My requirements: Platform: MT5 Timeframe: 5 or 15 minutes, if possible Instrument: XAUUSD (Gold) And Forex pair, if possible Fully automated trading Both BUY and SELL trades Open one trades at a time 1 to 2 ratio Adjustable lot size Stop Loss
Hi, I’m looking for a **ready-made MT5 scalping EA specifically for Gold (XAUUSD)**. My main requirement is an **HTF scalping strategy**, so I’m looking for an existing robot that is already developed and can be tested before I make the purchase. I’m not looking to build one from scratch at this stage. I would like to first test the EA on a **demo account** to see how it performs under live market conditions and
Are you able to build one bot for stock and one for ninja trader and tell me the win rate on it. I need ninja trader bot that enter buy and exit according the move to do not stay long in the market in each entry . That can follow the smart money concept or other if you have a good one
Hi there I need an developer to create a ea for mt5 and mt4 but the ea should be an fast connect ea meaning by taping the ea then automatically it connect to mt5 chart same in mt4 It should place order using invisible buy and invisible sell when the bid price breakout in 1 point Automatically it place an order depends on which direction and invisible stop loss in points , please reply if you can
Project Title: Development of a Custom Breakout Expert Advisor (EA) with Dynamic Trailing Stop, Advanced Security Filters, and On-Screen Dashboard for MT5 Project Description: Overview: I am looking for an experienced MQL5 developer to build a fully automated Trading Robot (Expert Advisor) for MetaTrader 5 based on a pending orders breakout strategy with strict dynamic risk management and customized time/profit
I need a TradingView Pine Script (v6) indicator that gives BUY and SELL signals in real time on the live chart. MAIN REQUIREMENT – NO REPAINTING: 1. Signals must appear only when the candle closes (barstate.isconfirmed). Example: on 1-min chart, signal for the 10:35 candle must appear at 10:36 and never disappear or move. 2. Signals on historical bars must look exactly the same as they looked live. 3. No lookahead
Project Title: Development of a Custom Breakout Expert Advisor (EA) with Dynamic Trailing Stop and On-Screen Dashboard for MT5 Project Description: Overview: I am looking for an experienced MQL5 developer to build a fully automated Trading Robot (Expert Advisor) for MetaTrader 5 based on a pending orders breakout strategy with strict dynamic risk management. The EA must be highly optimized, bug-free, and follow the
I am looking for an experienced developer to build a professional web-based trading performance dashboard connected to an MT5 trading account and/or FX Blue. The dashboard should automatically collect trading data and display: • Daily P&L calendar – profitable days green, losing days red and no-trade days grey • Equity/growth curve • Drawdown curve • Initial capital and current balance • Net profit and percentage
Hi, I’m looking for an experienced MQL5 developer to convert my TradingView Pine Script into an MT5 EA. Here are the main requirements: **MBS BREAKOUT** * Buy when price breaks the Green Line * Sell when price breaks the Red Line **TIMEFRAMES** * Strategy 1 = M1 * Strategy 2 = M5 * Strategy 3 = M15 * Strategy 4 = M30 * Strategy 5 = H1 * Strategy 6 = H4 * Strategy 7 = D1 * Strategy 8 = W1 * Strategy 9 = MN1 Each