Mql2Mq4转换工具 Beta V0.2 - 页 2

 

只要稍加努力,你就可以用Yousky的工具将mt2转换为mt4,附件是用他的beta3版本转换的,Yousky正在修复一些bug,很快就会有beta4版本。但是,当你在等待的时候,你有一些有趣的EA在MT3中,可以使用他的工具来转换它们。

很好的工具,谢谢

附加的文件:
 

所有的覆盖器都不起作用,我都试过了。 我在底部的窗口中得到了错误。

 

弗雷德。

你必须花时间来解决这些错误,转换器做了大部分工作,但会留下不使用的代码。这些代码必须被删除,在MT3中还有一些没有被引用的代码,这些代码也必须被删除或改变,然后你的EA才会工作。

转换器完成了95%的工作,其余的工作必须由你来做。

 

非常感谢Foreverold ,感谢您的帮助

我不得不说,有些EA的代码非常糟糕,例如在 "while "语法或 "if "中,你可以看到有些时候有一个或两个制动器没有被使用,例如。

if (StopLoss > 0)) then

在这里,你可以看到一个打开的制动器和2个关闭的制动器,在MQL2中,编译器没有给出任何错误,但在MQL4中却出现了错误。

因此, Mql2Mq4对一个EA来说是很好的编码,对其他的你必须进行手动修改。

我将改进我的工具,所以请告诉我哪些地方不工作,我希望能纠正它们。

谢谢你,拜拜

 

嗨,Yousky...

非常感谢这个伟大的工具

我已经将dayimpuls mql转换为mq4,但我不明白为什么它没有给出相同的值......

请看一下...

mql代码

/*[[

Name := DayImpuls

Author := Copyright © 2005, HomeSoftware Corp.

Link := spiky@sinet.spb.ru

Notes := Èíäèêàòîð ïðåäíàçíà÷åí äëÿ îïðåäåëåíèÿ òåíäåíöèè ðûíêà çà ïîñëåäíèå 24 ÷àñà íà ãðàôèêàõ Ì15

Separate Window := Yes

First Color := Yellow

First Draw Type := Line

First Symbol := 217

Use Second Data := Yes

Second Color := Red

Second Draw Type := Line

Second Symbol := 218

]]*/

Input : per(14),d(100),porog(30);

Variables : shift(0),i(0),imp(0),mBar(0),trigger(0);

SetLoopCount(0);

// loop from first bar to current bar (with shift=0)

For shift=Bars-1 Downto 0 Begin SetIndexValue(shift,0);SetIndexValue2(shift,0); End; mBar=d*per;

for shift=mBar downto per Begin imp=0;

for i=shift downto shift-per Begin imp=imp+(O-C);end;

imp=round(imp/point);if imp==0 then imp=0.0001;

if imp!=0 then Begin imp=-imp;SetIndexValue(shift-per,imp);end;

if imp>0 then trigger=porog;if imp<0 then trigger=-porog;

SetIndexValue2(shift-per,trigger);end;

[/PHP]

and mq4 code

[PHP]

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

//| DayImpuls.mq4

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

#property copyright ""

#property link ""

#property indicator_separate_window

#property indicator_buffers 2

#property indicator_color1 Gold

//---- input parameters

extern int per=14;

extern int d=100;

extern int porog=30;

//---- buffers

double ExtMapBuffer1[];

double ExtMapBuffer2[];

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

//| Custom indicator initialization function |

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

int init()

{

//---- indicators

SetIndexStyle(0,DRAW_LINE);

SetIndexBuffer(0,ExtMapBuffer1);

SetIndexStyle(1,DRAW_LINE);

SetIndexBuffer(1,ExtMapBuffer2);

//----

return(0);

}

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

//| Custor indicator deinitialization function |

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

int deinit()

{

//----

//----

return(0);

}

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

//| Custom indicator iteration function |

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

int start()

{

int counted_bars=IndicatorCounted();

int shift,i;

double imp,mBar,trigger;

for(shift=Bars-1;shift>=0 ;shift--)

{

ExtMapBuffer1[shift]=0;

ExtMapBuffer2[shift]=0;

}

mBar=d*per;

for(shift=mBar;shift>=per ;shift--)

{

imp=0;

for(i=shift;i>=shift-per ;i--)

{

imp=imp+(Open-Close);

}

imp=MathRound(imp/Point);

if( imp == 0 ) imp=0.0001;

if( imp != 0 )

{ imp=-imp;

ExtMapBuffer1[shift-per]=imp;

}

if( imp>0 ) trigger=porog;

if( imp<0 ) trigger=-porog;

ExtMapBuffer2[shift-per]=trigger;}

return(0);

}

我认为这一切都很好,但我不明白这种价值的差异

谢谢

 

嗨,hellkas。

我试着在MQ4中转换你的MQL2代码,我有相同的 "per "变量值。这是你的问题吗?

你已经公布了你的DayImpuls的所有代码?

 
yousky:
嗨,hellkas。

我试着在MQ4中转换你的MQL2代码,我有相同的 "per "变量值。这是你的问题吗?

你已经公布了你的DayImpuls的所有代码?

我把 "per "放在相同的值(14)...我的代码也是如此。

请看一下这个图片吧?

附加的文件:
implus_mql.jpg  42 kb
implus_mq4.jpg  46 kb
 

你好,hellkas。

你的问题是,你在MT3和MT4上转换后的结果不一样?你能公布你的MT3版本吗,我在转换后测试一下。

谢谢

 
yousky:
你好,hellkas。

那么你的问题是,你在MT3和MT4上转换后的结果不一样?你能不能把你的MT3版本贴出来,我在转换后进行测试。

谢谢

是的,这就是我的问题...

谢谢你。

附加的文件:
dayimpuls.mql  1 kb
 

嗨,hellkas。

我想在MT4和MT3上进行与您相同的测试,但我无法在MT3上创建模拟账户:-( 似乎服务器 "server.fxservice.com "不好 :-( 您能告诉我哪个服务器好吗?

谢谢

原因: