编码帮助 - 页 6

 

在EA编码方面需要帮助

嗨,我是MQL 4的新手,在学习了如何编写EA之后,我刚刚编写了一个EA,但不知道问题出在哪里。

当指标从红色变为蓝色时,我将在第二根蜡烛上用400PT 100SL进行多头交易。

当指标由蓝变红时,我将在第二根蜡烛上用400PT/100SL进行交易,每次只能进行1次交易。

到目前为止,我有一个函数定义的意外错误,我想,我不知道它有什么问题,我希望你能帮助我指出我的EA的错误,并帮助我纠正它。

谢谢

 

//---- 输入参数

extern double profittarget=400.0;

extern double stoploss=100.0;

extern double Lots=0.1;

#property indicator_chart_window

#属性 indicator_buffers 4

#属性 indicator_color1 红色

#属性 indicator_color2 蓝色

#属性 indicator_color3 红色

#属性 indicator_color4 蓝色

#属性 indicator_width1 1

#属性指示器宽度2 1

#属性指示器宽度3 3

#perty indicator_width4 3

//----

外部颜色 color1 = 红色。

外置颜色 color2 = Blue;

外置颜色 color3 = Red;

外置颜色 color4 = Blue;

//---- 缓冲区

double ExtMapBuffer1[];

double ExtMapBuffer2[];

double ExtMapBuffer3[];

双倍ExtMapBuffer4[]。

//----

int ExtCountedBars=0;

//+------------------------------------------------------------------+

//| 专家初始化函数 |

//+------------------------------------------------------------------+

int init()

{

//---- 指标

SetIndexStyle(0,DRAW_HISTOGRAM, 0, 1, color1);

SetIndexBuffer(0, ExtMapBuffer1);

SetIndexStyle(1,DRAW_HISTOGRAM, 0, 1, color2);

SetIndexBuffer(1, ExtMapBuffer2);

SetIndexStyle(2,DRAW_HISTOGRAM, 0, 3, color3);

SetIndexBuffer(2, ExtMapBuffer3);

SetIndexStyle(3,DRAW_HISTOGRAM, 0, 3, color4);

SetIndexBuffer(3, ExtMapBuffer4)。

//----

SetIndexDrawBegin(0,10);

SetIndexDrawBegin(1,10);

SetIndexDrawBegin(2,10);

SetIndexDrawBegin(3,10);

//----指标缓冲区 的映射

SetIndexBuffer(0,ExtMapBuffer1)。

SetIndexBuffer(1,ExtMapBuffer2);

SetIndexBuffer(2,ExtMapBuffer3);

SetIndexBuffer(3,ExtMapBuffer4)。

//---- 初始化完成

返回(0)。

}

//+------------------------------------------------------------------+

//|专家去初始化功能|

//+------------------------------------------------------------------+

int changing (double haOpen,double haClose,double haLow,double haHigh)

{

static int last_direction = 0;

static int current_direction = 0;

{如果(haOpen[1] haLow[1])=1。

如果(haOpen[1] > haClose[1] && haHigh[1] < haLow[1]) = 2;

如果(current_direction != last_direction)

{

last_direction = current_direction;

返回(last_direction)。

}

否则

{

返回(0)。

}

//+------------------------------------------------------------------+

//|专家启动功能|

//+------------------------------------------------------------------+

int start()

{

//----

int ticket;

如果(ExtCountedBars>0)ExtCountedBars--。

int pos=Bars-ExtCountedBars-1;

while(pos>=0)

haOpen=(ExtMapBuffer3[pos+1]+ExtMapBuffer4[pos+1])/2。

haClose=(Open[pos]+High[pos]+Low[pos]+Close[pos])/4。

haHigh=MathMax(High[pos], MathMax(haOpen, haClose))。

haLow=MathMin(Low[pos], MathMin(haOpen, haClose) )。

如果(haOpen<haClose)

{

ExtMapBuffer1[pos]=haLow。

ExtMapBuffer2[pos]=haHigh。

}

否则

{

ExtMapBuffer1[pos]=haHigh。

ExtMapBuffer2[pos]=haLow。

}

ExtMapBuffer3[pos]=haOpen;

ExtMapBuffer4[pos]=haClose。

pos--。

//进入符号

bool GoLong = false, GoShort = false;

int ticket;

如果(haOpen[2] haLow[2])=1 GoLong =true;

{

ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask+profittarget*Point;

}

如果(haOpen[2] > haClose[2] && haHigh[2] < haLow[2])= 2 GoShort=true;

{

ticket=OrderSend(Symbol(),OP_SELL,Lots,Ask+profittarget*Point;

}

// 买入 sl 评论

(OrderType() ==OP_BUY)

如果 stoploss=100.0;

OrderClose(OrderTicket(),OrderLots(),Bid,)。

//关闭头寸

返回(0)

}

//----

}

//+----------------------------------------------------------------+

 

ea

我可以帮助你编程一个EA。时间有限,请让我知道你的要求。

 

请帮助我。

我想知道是否有人能把我的一个指标变成EA,因为我目前没有时间在每笔交易中输入它的信号....。如果你能提供帮助,请给我留言....

谢谢你

普雷斯顿。

 

帮助制作MT4的CT指标

大家好

我有一个关于MT4反趋势指标的想法。但我不知道如何编码。

有没有人可以帮助我编写这个指标的程序?

 

ea

我可以为你做这件事,可能会有一些冲突,但几个月前已经做过类似的事情。

Play2020:
请帮助我。

我想知道是否有人能把我的一个指标变成EA,因为我目前没有时间在每笔交易中输入它的信号....。如果你能提供帮助,请给我留言....

谢谢你

普雷斯顿。
 

Ea

对反趋势要小心,如果操作不当,它们真的会混淆交易。

dancostar:
尊敬的各位

我有一个关于MT4反趋势指标的想法。但我不知道如何编码。

有没有人可以帮助我编写这个指标的程序?
 
Expert EA:
对反趋势要小心,如果操作不当,它们真的会混淆交易。

嗨,专家EA

我知道,但我有一个非常好的CT系统,但它很难观察所有的货币对,因此我正在寻求帮助,做指标会好得多。

我的CT系统的总体结果是80%左右的胜率!!!。

 

Ea

你交易的手数是多少,每周交易多少次,什么货币对?

dancostar:
嗨,专家EA

我知道,但我有一个很好的CT系统,但很难观察到所有的货币对,因此我正在寻求帮助,做指标会好得多。

我的CT的总体结果是80%左右的胜率!!!。
 
Expert EA:
你交易的手数是多少,每周交易多少次,什么货币对?

我做微型真实交易和迷你模拟交易

我正在交易11个货币对,这就是问题所在,我不能抓住所有的CT,因为它太多了,但当我看到一些时,我就接受了,关于CT的一个不好的想法是RR只有1:1,最大1:1.5,但赢率很大,就像我之前说的。

每周有多少次交易? 有时一次,有时四次。当我看到CT时,我就接受它,但我想用一些指标来帮助我更准确。

原因: