qUj6PLWA 发表于 2011-9-16 18:54:46

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


[*]//+------------------------------------------------------------------+
[*]//| 指标举例.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>=0;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);
[*]}//+------------------------------------------------------------------+

复制代码

sky 发表于 2012-11-22 01:12:18

晕不信啊

baoshan2007 发表于 2012-11-22 01:12:18

又看了一次

hate 发表于 2012-11-22 01:36:01

鉴定完毕.!

love869 发表于 2012-11-22 01:36:01

小生对楼主之仰慕如滔滔江水连绵不绝,海枯石烂,天崩地裂,永不变心.

你是否在笑 发表于 2012-11-22 01:36:01

我的啦嘿嘿

amy328 发表于 2012-11-22 01:36:01

我帮你 喝喝

搞笑 发表于 2012-11-22 01:36:01

现在越做月亏啊

小飞鱼常春 发表于 2012-11-22 01:36:01

我在顶贴~!~

ddszhxfe 发表于 2015-2-17 10:08:16

nice!!!!!!!!!!!!
页: [1] 2 3
查看完整版本: 11月7日MT4编程授课实例代码