如何编码? - 页 209

 

大家好...

谁能告诉我如何开始编码指标和EA?

 
kessing:
大家好...谁能告诉我如何开始编码指标和EA?

你好。

看这里:https://www.mql5.com/en/forum/172969/page2

 
kessing:
大家好...谁能告诉我如何开始编码指标和EA?

阅读这个主题(第一篇):https://www.mql5.com/en/forum/178706

和这个主题:https://www.mql5.com/en/forum/173290

 
kessing:
大家好......谁能告诉我如何开始编码指标和EA?

这里和FF上都有大量的信息。你也可以在谷歌上进行搜索。

关于EA编程的简单介绍, 看我签名中的链接。对于一个新手来说,这是一个很好的开始。

祝您好运!

拉克斯

 
 

指示器到EA

大家好。

我想请任何能将Waddah Attar Explosion附件做成EA的人帮忙。

期待听到大家的答复。

谢谢你。

-s-

附加的文件:
 

ea万能的马2十字架

大家好!

我正在寻找修改这个Firedave的EA(来自这个论坛)。

该EA被称为 "通用马氏交叉EA"

我想创建的是一个在2个交叉点确认的EA(例如,几个EMA 2和4,另几个EMA 5和20)。

这是主要的代码,我应该怎么做?

//----------------------- 设置变量的值

if(ConfirmedOnEntry==true)

{

if(CheckTime==iTime(NULL,TimeFrame,0)) return(0); else CheckTime = iTime(NULL, TimeFrame,0);

FastMACurrent = iMA(NULL,TimeFrame,FastMAPeriod,FastMAshift,FastMAType,FastMAPrice,1)。

SlowMACurrent = iMA(NULL,TimeFrame,SlowMAPeriod,SlowMAshift,SlowMAType,SlowMAPrice,1);

}

否则

{

FastMACurrent = iMA(NULL,TimeFrame,FastMAPeriod,FastMAshift,FastMAType,FastMAPrice,0);

SlowMACurrent = iMA(NULL,TimeFrame,SlowMAPeriod,SlowMAshift,SlowMAType,SlowMAPrice,0);

}

CrossDirection = subCrossDirection(FastMACurrent,SlowMACurrent)。

我已经尝试了所有的方法,但是我没有找到解决方案......为了这个社区的健康,请帮助我 ,我想要类似于这样的东西。

//----------------------- 设置变量的值

如果(ConfirmedOnEntry==true)

{

if(CheckTime==iTime(NULL,TimeFrame,0)) return(0); else CheckTime = iTime(NULL, TimeFrame,0);

FastMACurrent = iMA(NULL,TimeFrame,2,FastMAshift,FastMAType,FastMAPrice,1)。

SlowMACurrent = iMA(NULL,TimeFrame,4,SlowMAshift,SlowMAType,SlowMAPrice,1);

FastMACurrent2 = iMA(NULL,TimeFrame,5,FastMAshift,FastMAType,FastMAPrice,1);

SlowMACurrent2 = iMA(NULL,TimeFrame,20,SlowMAshift,SlowMAType,SlowMAPrice,1);

}

否则

{

FastMACurrent = iMA(NULL,TimeFrame,2,FastMAshift, FastMAType,FastMAPrice,0);

SlowMACurrent = iMA(NULL,TimeFrame,4,SlowMAshift,SlowMAType,SlowMAPrice,0);

FastMACurrent2 = iMA(NULL,TimeFrame,5,FastMAshift,FastMAType,FastMAPrice,0);

SlowMACurrent2 = iMA(NULL,TimeFrame,20,SlowMAshift,SlowMAType,SlowMAPrice,0);

}

CrossDirection = subCrossDirection(FastMACurrent,SlowMACurrent && FastMACurrent2, SlowMACurrent2);

附加的文件:
 

我的指标有什么问题?错误信息

你好。

以下是我的指标的代码。

#property indicator_separate_window

#属性 indicator_buffers 2

#属性 indicator_color1 LightSeaGreen

#属性 indicator_color2 蓝色

extern string Timeframe_Momentum = "PERIOD_H1";

extern int Periode_Momentum = 500;

Extern int Periode_MA_Momentum = 8;

double Buffer_Mom[];

double Buffer_Ma[]。

int init()

{

//---- 指标

SetIndexStyle(0,DRAW_LINE);

SetIndexStyle(1,DRAW_LINE);

SetIndexBuffer(0,Buffer_Mom);

SetIndexBuffer(1,Buffer_Ma);

//----

SetIndexEmptyValue(0,0.0)。

SetIndexEmptyValue(1,0.0);

SetIndexDrawBegin(0,100);

SetIndexDrawBegin(1,100);

//----

返回(0)。

}

int deinit()

{

//----

return(0);

}

空白启动()

{

int counted_bars=IndicatorCounted();

int limit=Bars-counted_bars;

如果(counted_bars>0) limit++;

//----

for(int i=0; i<limit; i++)

{

Buffer_Mom=iMomentum(NULL,Timeframe_Momentum,Periode_Momentum,PRICE_CLOSE,i)。

Buffer_Ma=iMAOnArray(Buffer_Mom,0,Periode_MA_Momentum,0,MODE_SMA,i);

}

return(0);

}

下面是我在主程序中使用的代码。

double GMI1 = iCustom(NULL,0, "GMI",Timeframe_Momentum,Periode_Momentum,Periode_MA_Momentum, 0,1)。

double GMI2 = iCustom(NULL,0, "GMI",Timeframe_Momentum,Periode_Momentum,Periode_MA_Momentum, 1,2);

现在我的问题是。

我得到这个错误信息。 EURUSD,M5: 指标调用函数 的参数2是无效的整数

而且在我的图表中没有Buffer_Ma!我的代码有什么问题吗?

 

你好

如何计算开盘价和上一交易日的最高价之间的标准差

任何帮助都将是巨大的。

谢谢

贝诺

 

PERIOD_H1是一个互斥宏,请将这一行改为

extern int TimeFrame_Momentum = PERIOD_H1;

或者将PERIOD_H1替换为60,然后尝试一下

sunshineh:
你好。

以下是我的指标的代码。

#property indicator_separate_window

#属性 indicator_buffers 2

#属性 indicator_color1 LightSeaGreen

#属性 indicator_color2 蓝色

extern string Timeframe_Momentum = "PERIOD_H1";

extern int Periode_Momentum = 500;

Extern int Periode_MA_Momentum = 8;

double Buffer_Mom[];

double Buffer_Ma[]。

int init()

{

//---- 指标

SetIndexStyle(0,DRAW_LINE);

SetIndexStyle(1,DRAW_LINE);

SetIndexBuffer(0,Buffer_Mom);

SetIndexBuffer(1,Buffer_Ma);

//----

SetIndexEmptyValue(0,0.0)。

SetIndexEmptyValue(1,0.0);

SetIndexDrawBegin(0,100);

SetIndexDrawBegin(1,100);

//----

返回(0)。

}

int deinit()

{

//----

return(0);

}

空白启动()

{

int counted_bars=IndicatorCounted();

int limit=Bars-counted_bars;

如果(counted_bars>0) limit++;

//----

for(int i=0; i<limit; i++)

{

Buffer_Mom=iMomentum(NULL,Timeframe_Momentum,Periode_Momentum,PRICE_CLOSE,i)。

Buffer_Ma=iMAOnArray(Buffer_Mom,0,Periode_MA_Momentum,0,MODE_SMA,i);

}

return(0);

}

下面是我在主程序中使用的代码。

double GMI1 = iCustom(NULL,0, "GMI",Timeframe_Momentum,Periode_Momentum,Periode_MA_Momentum, 0,1)。

double GMI2 = iCustom(NULL,0, "GMI",Timeframe_Momentum,Periode_Momentum,Periode_MA_Momentum, 1,2);

现在我的问题是。

我得到这个错误信息。EURUSD,M5: 指标调用函数的参数2是无效的整数

而且我的图表中没有Buffer_Ma!我的代码有什么问题吗?
原因: