客服热线:18391752892

11月7日MT4编程授课实例代码

   日期:2019-01-12     浏览:914    
马上注册,结交更多好友,下载更多资源

您需要 登录 才可以下载或查看,没有帐号?注册 //+------------------------------------------------------------------+
//| 指标举例.mq4 |
//| Copyright ?2007, 520FX Corp. |
//| http://www.520fx.com |
//+------------------------------------------------------------------+
#property copyright Copyright ?2007, 520FX Corp.
#property link http://www.520fx.com
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 White
#property indicator_color2 Yellow
extern int Ma=12;
extern int Ma1=36;
double MaLine[],Ma1Line[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
IndicatorBuffers(2);
SetIndexStyle(0,DRAW_LINE);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(0,MaLine);
SetIndexBuffer(1,Ma1Line);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int limit;
int counted_bars=IndicatorCounted();
if(counted_bars0) counted_bars--;
limit=Bars-counted_bars;
for (int i=limit-1;i i--)
{
MaLine=iMA(NULL,0,Ma,0,MODE_SMA,PRICE_CLOSE,i);
Ma1Line=iMA(NULL,0,Ma1,0,MODE_SMA,PRICE_CLOSE,i);
}
//----
return(0);
}//+------------------------------------------------------------------+

外汇交易有很大的风险性,本站所有资源均来自网络,请选择使用,如若出现亏损,本站不承担任何责任!


特别提示:本信息由相关企业自行提供,真实性未证实,仅供参考。请谨慎采用,风险自负。


0相关评论
相关行情
推荐行情
点击排行