请观看如何免费下载自动交易

有趣的脚本?
因此发布一个链接 -
让其他人评价

喜欢这个脚本? 在MetaTrader 5客户端尝试它

指标

变色MA趋势交易与MACD震荡交易利器源码 - MetaTrader 4脚本

Gui Li

显示:
3588
等级:
投票: 2
已发布:
2019.04.26 13:00
已更新:
2019.04.26 13:04
1.MACD.mq4 (8.52 KB)预览

原文:http://www.nvjan.com/forum.php?mod=viewthread&tid=22107&page=1&extra=#pid1169651

所有附件请到原文下载,这里仅仅提供一个例子。

功能:利用MACD震荡交易,提示金叉与死叉交易点;同时,利用MA进行趋势交易。趋势与震荡两不误。


安装方法:
解压后,复制到:MQL4/技术指标
使用方面:
解压后,复制到:MQL4/技术指标
使用方面:
1.MACD:MACD幅图
2.MA-main:MA主图
3.MACD-Cross:MACD金叉,死叉显示与提示例子:

例子:1.MACD:

#property copyright   "Copyright 2017-2019, Nvjan Inc."
#property link        "http://www.nvjan.com"
#property version     "2.00"
#property description "M-Color MACD Indicators "
#property strict

#property indicator_buffers 6
#property indicator_separate_window
#property indicator_level1 0
#property indicator_color1 White
#property indicator_color2 Red
#property indicator_color3 Red
#property indicator_color4 Lime
#property indicator_color5 Yellow
#property indicator_color6 Blue

//---- buffers
double Buffer1[];
double Buffer2[];
double Buffer3[];
double Buffer4[];
double UP[];
double DO[];

extern int Fast = 12;
extern int Slow = 26;
extern int Signal = 9;
extern bool Alert_Switch=true;
static double SX;


//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   //IndicatorBuffers(3);
   SetIndexStyle(0,DRAW_LINE,0,1);
   SetIndexStyle(1,DRAW_LINE,0,1);
   SetIndexStyle(2,DRAW_HISTOGRAM,0,2);
   SetIndexStyle(3,DRAW_HISTOGRAM,0,2);
   SetIndexStyle(4,DRAW_ARROW);
   SetIndexStyle(5,DRAW_ARROW);
   SetIndexArrow(4,233);
   SetIndexArrow(5,234);

   SetIndexBuffer(0,Buffer1);
   SetIndexBuffer(1,Buffer2);
   SetIndexBuffer(2,Buffer3); 
   SetIndexBuffer(3,Buffer4); 
   SetIndexBuffer(4,UP);
   SetIndexBuffer(5,DO);


   IndicatorShortName("MACD("+Fast+","+Slow+","+Signal+")");
   SetIndexLabel(0,"MACD_MAIN");
   SetIndexLabel(1,"MACD_SIGNAL");
   SetIndexLabel(2,"MAIN-SIGNAL");
   SetIndexLabel(3,"MAIN-SIGNAL");
   SetIndexLabel(4,"BUY_SIGNAL");
   SetIndexLabel(5,"SELL-SIGNAL");
   IndicatorDigits(Digits+2);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
{
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int limit,counted_bars=IndicatorCounted();
//---- check for possible errors
   if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
   double B_Temp;
  //---- main loop
   for(int i=0; i<limit; i++)
     {
      Buffer1[i]=iMACD(NULL,0,Fast,Slow,Signal,PRICE_CLOSE,MODE_MAIN,i); 
      Buffer2[i]=iMACD(NULL,0,Fast,Slow,Signal,PRICE_CLOSE,MODE_SIGNAL,i); 
      B_Temp=Buffer1[i] - Buffer2[i];
      if (B_Temp>=0)
      {
        Buffer3[i]=B_Temp;
        Buffer4[i]=EMPTY_VALUE;
      }
      else
      {
        Buffer4[i]=B_Temp;
        Buffer3[i]=EMPTY_VALUE;
      }
     }
   for(i=0; i<limit; i++)
     {
      UP[i]=EMPTY_VALUE;
      DO[i]=EMPTY_VALUE;
      if (Buffer1[i]>Buffer2[i]  &&  Buffer1[i+1]<Buffer2[i+1]) 
      UP[i]=Buffer2[i];
      if (Buffer1[i]<Buffer2[i]  &&  Buffer1[i+1]>Buffer2[i+1]) 
      DO[i]=Buffer2[i];
      if (Buffer1[i]>Buffer2[i]  &&  Buffer1[i+1]==Buffer2[i+1]  &&  Buffer1[i+2]<Buffer2[i+2]) 
      UP[i]=Buffer2[i];
      if (Buffer1[i]<Buffer2[i]  &&  Buffer1[i+1]==Buffer2[i+1]  &&  Buffer1[i+2]>Buffer2[i+2]) 
      DO[i]=Buffer2[i];
     }
   if (Alert_Switch==true && Buffer1[0]>Buffer2[0]  &&  Buffer1[1]<Buffer2[1] && SX!=Time[0]) 
   {
     Alert(Symbol(),"  ",Period(),":","MACD金叉");
     SX=Time[0];
   }
   if (Alert_Switch==true && Buffer1[0]<Buffer2[0]  &&  Buffer1[1]>Buffer2[1] && SX!=Time[0]) 
   {
     SX=Time[0];
     Alert(Symbol(),"  ",Period(),":","MACD死叉");
   }
   if (Alert_Switch==true && Buffer1[0]>Buffer2[0]  &&  Buffer1[1]==Buffer2[1]  &&  Buffer1[2]<Buffer2[2] && SX!=Time[0]) 
   {
     SX=Time[0];
     Alert(Symbol(),"  ",Period(),":","MACD金叉");
   }
   if (Alert_Switch==true && Buffer1[0]<Buffer2[0]  &&  Buffer1[1]==Buffer2[1]  &&  Buffer1[2]>Buffer2[2] && SX!=Time[0]) 
   {
     SX=Time[0];
     Alert(Symbol(),"  ",Period(),":","MACD死叉");
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+ 



Original: http://www.nvjan.com/forum.php?mod=viewthread&tid=22107&page=1&extra=#pid1169651

All attachments are available for download in the original text. Here is just an example.

Function: Use MACD to oscillate the transaction, prompting the golden fork and the dead fork trading point; meanwhile, use the MA for trend trading. The trend and the shock are both correct.


installation method:
After decompression, copy to: MQL4/Technical Specifications
Use aspect:
1.MACD: MACD Fig 
2.MA-main: MA main Fig
3.MACD-Cross: MACD gold fork, dead fork display and notice

    MT4 One Key Trading MT4 One Key Trading

    MT4 One Key Trader:一键交易,双击脚本即可自动完成:买入,卖出,平仓,删除挂单,删除物体。

    剥头皮 剥头皮

    这是一个根据均线趋势为指引的剥头皮EA。提供参考学习,不建议用于实盘。

    EagleEyed 鹰眼指标 EagleEyed 鹰眼指标

    指标把1小时内所有标准周期的蜡烛图放在一起呈现,这样可以清楚的知道当前周期运动在H1周期的哪个位置,还有多少上升和下降距离。 指标自上至下,依次时间周期是H1 -> M30 -> M15 -> M5 -> M1。 H1的标题指示区显示当前H1在H4的哪个位置,例如0:00-3:59的H4区间,当前H1为00:00-00:59, 则为1/4。

    Pan PrizMA Sin leverage 72 Pan PrizMA Sin leverage 72

    该指标基于4度多项式的插值建立滑动线。构造的线外推正弦波及其轴向或接近恒定的line_power = 2,或接近倾斜线line_power = 3 (重新绘制以使图形可视化)。 从构建的正弦曲线和轴向中,在每个条上移除一个值,并且构造一行外推值, 其不重新绘制 。