编码帮助 - 页 226

 

尊敬的伟大的程序员。

请帮助我修改这个Ea,使其在每个周期开始时可以只开买单或只开卖单。

对不起,我的英语不好。

谢谢

Mark010breakouthedge.mq4

附加的文件:
 
Mark010:
亲爱的伟大的程序员。

请帮助我修改这个Ea,使之有可能在每个周期开始时只开买单或只开卖单。

对不起,我的英语不好。

谢谢

Mark010breakouthedge.mq4

Mark010

你有原始的源代码吗?那是一个反编译的代码,我怀疑你是否能通过反编译的代码修改得到一些帮助。

 

我没有这个东西。

还是谢谢你

 
mladen:
elcomepips 给你

嘿,mladen。

我看到你编得很好。我需要用iCustom()导入 哪些缓冲区来制作一个EA。我只想知道我是否必须做多或做空。

提前感谢。

 
arroganzmaschine:
hey mladen,

我看到你编得很好。我需要用iCustom()导入哪些缓冲区来制作一个EA。我只想知道我是否必须做多或做空。

先谢谢了。

阿罗冈兹-马斯奇

你可以用缓冲区2来做这个。当它的值是1时,那么趋势是向上的,如果值是-1,那么趋势是向下的。代码可以是这样的。

double currentTrend = iCustom(NULL,0,"MA crosses arrows_alerts mtf","",FastMa,FastMaShift,FastMAMethod,FastMAPrice,SlowMa,SlowMaShift,SlowMAMethod,SlowMAPrice,2,1);

double previousTrend = iCustom(NULL,0,"MA crosses arrows_alerts mtf","",FastMa,FastMaShift,FastMAMethod,FastMAPrice,SlowMa,SlowMaShift,SlowMAMethod,SlowMAPrice,2,2);

if (currentTrend != previousTrend)

{

if (currentTrend == 1) // buy signal

if (currentTrend == -1) // sell signal

}

 
mladen:
傲慢无礼

你可以用缓冲区2来做这个。当它的值为1时,那么趋势是向上的,如果值为-1,那么趋势是向下的。代码可以是这样的。

double currentTrend = iCustom(NULL,0,"MA crosses arrows_alerts mtf","",FastMa,FastMaShift,FastMAMethod,FastMAPrice,SlowMa,SlowMaShift,SlowMAMethod,SlowMAPrice,2,1);

double previousTrend = iCustom(NULL,0,"MA crosses arrows_alerts mtf","",FastMa,FastMaShift,FastMAMethod,FastMAPrice,SlowMa,SlowMaShift,SlowMAMethod,SlowMAPrice,2,2);

if (currentTrend != previousTrend)

{

if (currentTrend == 1) // buy signal

if (currentTrend == -1) // sell signal

}

我必须如何定义FastMa等?那是不行的,因为它不存在。

 
arroganzmaschine:
我必须如何定义FastMa等?那是不行的,因为它不存在。

你必须将它们声明为外部变量(与指标参数 完全相同)。像这样:

extern int FastMa = 5;

extern int FastMaShift = 0;

extern int FastMAMethod = MODE_LWMA;

extern int FastMAPrice = PRICE_CLOSE;

extern int SlowMa = 13;

extern int SlowMaShift = 0;

extern int SlowMAMethod = MODE_LWMA;

extern int SlowMAPrice = PRICE_CLOSE;

使用任何你喜欢的默认值,而不是上面代码中的值。

 
mladen:
你必须把它们声明为外部变量(与指标参数完全一样)。像这样:
extern int FastMa = 5;

extern int FastMaShift = 0;

extern int FastMAMethod = MODE_LWMA;

extern int FastMAPrice = PRICE_CLOSE;

extern int SlowMa = 13;

extern int SlowMaShift = 0;

extern int SlowMAMethod = MODE_LWMA;

extern int SlowMAPrice = PRICE_CLOSE;

使用任何你喜欢的默认值,而不是上面代码中的值

非常感谢您!如果currentTrend==1,我怎样才能只有一个订单?

我不想开大量的订单。

 
arroganzmaschine:
非常感谢您如果currentTrend==1,我怎样才能只下一个订单? 我不想开大量的订单。

要么使用OrdersTotal()< 1,要么对当前符号和神奇数字使用一些订单计数函数。

 

你好,Mladen,你做了这个指标的版本。我想要求在这里单独制作移动平均线,就像其他指标的例子那样,如果可能的话。

谢谢你。

附加的文件:
原因: