想问一下类似布林指标K线在上下轨时提醒功能怎么设置还是需要专门EA提醒
如题。想问一下类似布林指标K线刚碰到上下轨时或者MACD穿越0轴时提醒功能怎么设置还是需要专门EA提醒这个需要指标打开提醒功能,声音弹出报警在你的指标里打开就行参考如标记的1号图,如果需要邮件报警,参考剩下的两个图 在指标或者ea里面加入代码功能,然后在MT4选项里面输入邮件的路径和授权码 指标直接设置里面没有。我已经打开了邮箱提醒。
在指标里面加入代码功能,是修改指标?我看有一个教程是这样写的邮件报警:
当(条件达到)执行此语句时,发送一个邮件。
(收发件人地址在MT4系统中设置详见《MT4编程实例1:一个简单的小程序,让你的手机摇身变成外汇行情接收机》)
格式:SendMail(标题1+标题2, 内容1+内容2);
标题之间以加号连接,内容之间也以加号连接
邮件标题和邮件内容以逗号间隔。 WA263222 发表于 2024-12-9 10:13
这个需要指标打开提醒功能,声音弹出报警在你的指标里打开就行参考如标记的1号图,如果需要邮件报警,参考 ...
这个是一个EA 吧? 本帖最后由 m1800 于 2024-12-9 16:44 编辑
我有布林指标K线刚碰到上下轨时警报提醒,加q14060258 指标下面加一个邮件提醒就行 WA263222 发表于 2024-12-9 20:05
指标下面加一个邮件提醒就行
能详细点吗?不会编程。 月婕 发表于 2024-12-17 09:32
能详细点吗?不会编程。
你发到回复里,我给你加,报警内容需要北京时间函数还是平台时间函数? 北京时间函数是发这个吗?//+------------------------------------------------------------------+
//| ATR.mq4 |
//| Copyright 2005-2014, MetaQuotes Software Corp. |
//| http://www.mql4.com |
//+------------------------------------------------------------------+
#property copyright "2005-2014, MetaQuotes Software Corp."
#property link "http://www.mql4.com"
#property description "Average True Range"
#property strict
//--- indicator settings
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1DodgerBlue
//--- input parameter
input int InpAtrPeriod=14; // ATR Period
//--- buffers
double ExtATRBuffer[];
double ExtTRBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit(void)
{
string short_name;
//--- 1 additional buffer used for counting.
IndicatorBuffers(2);
IndicatorDigits(Digits);
//--- indicator line
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ExtATRBuffer);
SetIndexBuffer(1,ExtTRBuffer);
//--- name for DataWindow and indicator subwindow label
short_name="ATR("+IntegerToString(InpAtrPeriod)+")";
IndicatorShortName(short_name);
SetIndexLabel(0,short_name);
//--- check for input parameter
if(InpAtrPeriod<=0)
{
Print("Wrong input parameter ATR Period=",InpAtrPeriod);
return(INIT_FAILED);
}
//---
SetIndexDrawBegin(0,InpAtrPeriod);
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Average True Range |
//+------------------------------------------------------------------+
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[])
{
int i,limit;
//--- check for bars count and input parameter
if(rates_total<=InpAtrPeriod || InpAtrPeriod<=0)
return(0);
//--- counting from 0 to rates_total
ArraySetAsSeries(ExtATRBuffer,false);
ArraySetAsSeries(ExtTRBuffer,false);
ArraySetAsSeries(open,false);
ArraySetAsSeries(high,false);
ArraySetAsSeries(low,false);
ArraySetAsSeries(close,false);
//--- preliminary calculations
if(prev_calculated==0)
{
ExtTRBuffer=0.0;
ExtATRBuffer=0.0;
//--- filling out the array of True Range values for each period
for(i=1; i<rates_total; i++)
ExtTRBuffer=MathMax(high,close)-MathMin(low,close);
//--- first AtrPeriod values of the indicator are not calculated
double firstValue=0.0;
for(i=1; i<=InpAtrPeriod; i++)
{
ExtATRBuffer=0.0;
firstValue+=ExtTRBuffer;
}
//--- calculating the first value of the indicator
firstValue/=InpAtrPeriod;
ExtATRBuffer=firstValue;
limit=InpAtrPeriod+1;
}
else
limit=prev_calculated-1;
//--- the main loop of calculations
for(i=limit; i<rates_total; i++)
{
ExtTRBuffer=MathMax(high,close)-MathMin(low,close);
ExtATRBuffer=ExtATRBuffer+(ExtTRBuffer-ExtTRBuffer)/InpAtrPeriod;
}
//--- return value of prev_calculated for next call
return(rates_total);
}
//+------------------------------------------------------------------+
页:
[1]
2