您需要 登录 才可以下载或查看,没有帐号?注册
macd 穿0报警提示,需要多少钱,会的可以联系
//+------------------------------------------------------------------+
//| test.mq4 |
//| Copyright 2015, metaQuotes Software Corp. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright Copyright 2015, metaQuotes Software Corp.
#property link https://www.mql5.com
#property version 1.00
#property strict
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
extern string flag1 = 快线
input int l_fast = 5;
extern string flag2 = 慢线
input int l_slow = 20;
extern string flag3 = 信号线
input int l_signal = 18;
extern string flag4 = 误差值
input double deviation = 0.0;
extern string flag5 = K线推移(0为当前K线)
input int shift = 0;
datetime now = 0;
int onInit()
{
//--- create timer
EventSetTimer(60);
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void onDeinit(const int reason)
{
//--- destroy timer
EventKillTimer();
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void onTick()
{
//---
if(now != Time[0])
{ now = Time[0];
double main0 = iMACD(Symbol(), 0, l_fast, l_slow, l_signal, PRICE_CLOSE, MODE_MAIN, shift);
double signal0 = iMACD(Symbol(), 0, l_fast, l_slow, l_signal, PRICE_CLOSE, MODE_SIGNAL, shift);
double main1 = iMACD(Symbol(), 0, l_fast, l_slow, l_signal, PRICE_CLOSE, MODE_MAIN, shift + 1);
double signal1 = iMACD(Symbol(), 0, l_fast, l_slow, l_signal, PRICE_CLOSE, MODE_SIGNAL, shift + 1);
if(main0 0 main1 0)
{
alert( MACD上穿
PlaySound( alert.wav
}
else if(main0 0 main1 0)
{
alert( MACD下穿
PlaySound( alert.wav
}
if(signal0 0 signal1 0)
{
alert( 信号线上穿
PlaySound( alert.wav
}
else if(signal0 0 signal1 0)
{
alert( 信号线下穿
PlaySound( alert.wav
}
}
}
//+------------------------------------------------------------------+
//| Timer function |
//+------------------------------------------------------------------+
void onTimer()
{
//---
}
//+------------------------------------------------------------------+
//| Tester function |
//+------------------------------------------------------------------+
double onTester()
{
//---
double ret=0.0;
//---
//---
return(ret);
}
//+------------------------------------------------------------------+
//| ChartEvent function |
//+------------------------------------------------------------------+
void onChartEvent(const int id,
const long lparam,
const double dparam,
const string sparam)
{
//---
}
//+------------------------------------------------------------------+
外汇交易有很大的风险性,本站所有资源均来自网络,请选择使用,如若出现亏损,本站不承担任何责任!