HELP !!!! 将一个指标从MT4转换到MT5。 - 页 4

 
George Merts:

是的,想象一下,你所提出的建议需要付出一定的努力,因此也需要付出金钱。

每个人都能很好地理解俄语,但很少有人有兴趣 "为了感谢你 "而做这个。

但是,如果你有成功的交易经验,其中你会需要一个指标,也许有人会同意做一些没有钱的事情,以换取一个有利可图的交易理念。同时--纯粹是为了 "好名声"--恐怕不会有多少人愿意这样做......

我的个人经验与此毫无关系。

那么,传说中的石牧对你来说并不熟悉?多年来,它不是已经证明了自己吗?

这不是一个交易机器人会不会损失存款的问题。

这是一个传统的石木,上面拧着一个警报。决定权在交易员手中。

这就是你对俄罗斯语言的误解--你甚至没有读过我的 帖子。

我甚至添加了mt4的IchimokuAlert_v3.mq4 指标,并写道我使用它。

这是mt4指标IchimokuAlert_v3.mq4 的代码,供无法下载的人 使用。

//+------------------------------------------------------------------+
//|                                             IchimokuAlert_v2.mq4 |
//|                                  Copyright © 2006, Forex-TSD.com |
//|                         Written by IgorAD,igorad2003@yahoo.co.uk |
//|                           Adapted and improved by Snowski © 2009 |  
//+------------------------------------------------------------------+

#property copyright "Copyright © 2006, Forex-TSD.com "
#property link      "http://www.forex-tsd.com/"

#property indicator_chart_window
#property indicator_buffers 7
#property indicator_color1 Red
#property indicator_color2 Blue
#property indicator_color3 SandyBrown
#property indicator_color4 Thistle
#property indicator_color5 Lime
#property indicator_color6 SandyBrown
#property indicator_color7 Thistle

//---- input parameters
extern int Tenkan             = 9;
extern int Kijun              = 26;
extern int Senkou             = 52;
extern bool UseAlerts         = true;
extern bool MsgAlerts         = true;
extern bool SoundAlerts       = true;
extern bool eMailAlerts       = false;
extern int AlertType          = 1;
extern string Alert_Setting   = "--- Alert Type:---";
extern string A_S0            = "0 = no alert";
extern string A_S1            = "1 = Tenkan crosses Kjiun";
extern string A_S2            = "2 = Kijun crosses Price";
extern string A_S3            = "3 = both";
extern bool Show_Tenkan       = true;
extern bool Show_Kijun        = true;
extern bool Show_Senkou       = true;
extern bool Show_Kumo         = true;
//---- buffers
double Tenkan_Buffer[];
double Kijun_Buffer[];
double SpanA_Buffer[];
double SpanB_Buffer[];
double Chinkou_Buffer[];
double SpanA2_Buffer[];
double SpanB2_Buffer[];
//----
int a_begin;
bool UptrendAlert1,DntrendAlert1,UptrendAlert2,DntrendAlert2;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//----
   if(Show_Tenkan==true){
      SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,2);
      SetIndexBuffer(0,Tenkan_Buffer);
      SetIndexDrawBegin(0,Tenkan-1);
      SetIndexLabel(0,"Tenkan Sen");
   }  
//----
   if(Show_Kijun==true){
      SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,2);
      SetIndexBuffer(1,Kijun_Buffer);
      SetIndexDrawBegin(1,Kijun-1);
      SetIndexLabel(1,"Kijun Sen");
      }
//----
   if(Show_Kumo==true){
      a_begin=Kijun; if(a_begin<Tenkan) a_begin=Tenkan;
      SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_DOT);
      SetIndexBuffer(2,SpanA_Buffer);
      SetIndexDrawBegin(2,Kijun+a_begin-1);
      SetIndexShift(2,Kijun);
      SetIndexLabel(2,NULL);
      SetIndexStyle(5,DRAW_LINE,STYLE_SOLID);
      SetIndexBuffer(5,SpanA2_Buffer);
      SetIndexDrawBegin(5,Kijun+a_begin-1);
      SetIndexShift(5,Kijun);
      SetIndexLabel(5,"Senkou Span A");
   }
//----
   if(Show_Kumo==true){
      SetIndexStyle(3,DRAW_HISTOGRAM,STYLE_DOT);
      SetIndexBuffer(3,SpanB_Buffer);
      SetIndexDrawBegin(3,Kijun+Senkou-1);
      SetIndexShift(3,Kijun);
      SetIndexLabel(3,NULL);
      SetIndexStyle(6,DRAW_LINE,STYLE_SOLID);
      SetIndexBuffer(6,SpanB2_Buffer);
      SetIndexDrawBegin(6,Kijun+Senkou-1);
      SetIndexShift(6,Kijun);
      SetIndexLabel(6,"Senkou Span B");
   }
//----
   if(Show_Senkou==true){
      SetIndexStyle(4,DRAW_LINE);
      SetIndexBuffer(4,Chinkou_Buffer);
      SetIndexShift(4,-Kijun);
      SetIndexLabel(4,"Chinkou Span");
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Ichimoku Kinko Hyo                                               |
//+------------------------------------------------------------------+
int start()
{
   int    i,k;
   int    counted_bars=IndicatorCounted();
   double high,low,price;
//----
   if(Bars<=Tenkan || Bars<=Kijun || Bars<=Senkou) return(0);
//---- initial zero
   if(counted_bars<1)
     {
      for(i=1;i<=Tenkan;i++)    Tenkan_Buffer[Bars-i]=0;
      for(i=1;i<=Kijun;i++)     Kijun_Buffer[Bars-i]=0;
      for(i=1;i<=a_begin;i++) { SpanA_Buffer[Bars-i]=0; SpanA2_Buffer[Bars-i]=0; }
      for(i=1;i<=Senkou;i++)  { SpanB_Buffer[Bars-i]=0; SpanB2_Buffer[Bars-i]=0; }
     }
//---- Tenkan Sen
      i=Bars-Tenkan;
      if(counted_bars>Tenkan) i=Bars-counted_bars-1;
         while(i>=0)
            {
            high=High[i]; low=Low[i]; k=i-1+Tenkan;
         while(k>=i)
            {
            price=High[k];
            if(high<price) high=price;
            price=Low[k];
            if(low>price)  low=price;
            k--;
           }
         Tenkan_Buffer[i]=(high+low)/2;
         i--;
      }
//---- Kijun Sen
   i=Bars-Kijun;
   if(counted_bars>Kijun) i=Bars-counted_bars-1;
   while(i>=0)
     {
      high=High[i]; low=Low[i]; k=i-1+Kijun;
      while(k>=i)
        {
         price=High[k];
         if(high<price) high=price;
         price=Low[k];
         if(low>price)  low=price;
         k--;
        }
      Kijun_Buffer[i]=(high+low)/2;
      i--;
     }
//---- Senkou Span A
   i=Bars-a_begin+1;
   if(counted_bars>a_begin-1) i=Bars-counted_bars-1;
   while(i>=0)
     {
      price=(Kijun_Buffer[i]+Tenkan_Buffer[i])/2;
      SpanA_Buffer[i]=price;
      SpanA2_Buffer[i]=price;
      i--;
     }
//---- Senkou Span B
   i=Bars-Senkou;
   if(counted_bars>Senkou) i=Bars-counted_bars-1;
   while(i>=0)
     {
      high=High[i]; low=Low[i]; k=i-1+Senkou;
      while(k>=i)
        {
         price=High[k];
         if(high<price) high=price;
         price=Low[k];
         if(low>price)  low=price;
         k--;
        }
      price=(high+low)/2;
      SpanB_Buffer[i]=price;
      SpanB2_Buffer[i]=price;
      i--;
     }
//---- Chinkou Span
   i=Bars-1;
   if(counted_bars>1) i=Bars-counted_bars-1;
   while(i>=0) { Chinkou_Buffer[i]=Close[i]; i--; }
  
//----
   string Msg,Subj;
  
   if (AlertType == 1 || AlertType == 3)
   {
      if (Tenkan_Buffer[1]>Kijun_Buffer[1] && Tenkan_Buffer[2]<Kijun_Buffer[2] && !UptrendAlert1)
      {
         Subj = "Tenkan crosses Kijun: "+Symbol()+" on M"+Period();
         Msg = "BUY Signal --- : "+Subj+ " @ "+DoubleToStr(Close[1],Digits) + ", @ " + TimeToStr(TimeLocal(),TIME_SECONDS);
         UptrendAlert1 = true;
         DntrendAlert1 = false;
         DoAlerts(Msg,Subj);
      }
      if ( Tenkan_Buffer[1]<Kijun_Buffer[1] && Tenkan_Buffer[2]>Kijun_Buffer[2] && !DntrendAlert1)
      {  
         Subj = "Tenkan crosses Kijun: "+Symbol()+" on M"+Period();
         Msg = "SELL Signal --- : "+Subj+ " @ "+DoubleToStr(Close[1],Digits) + ", @ " + TimeToStr(TimeLocal(),TIME_SECONDS);
         UptrendAlert1 = false;
         DntrendAlert1 = true;
         DoAlerts(Msg,Subj);
      }
   }
  
   if (AlertType == 2 || AlertType == 3)
   {
      if (Close[1]>Close[1+Kijun] && Close[2]<Close[2+Kijun] && !UptrendAlert2)
      {
         Subj = "Kijun crossed Price: "+Symbol()+" on M"+Period();
         Msg = "BUY Signal --- : "+Subj+ " @ "+DoubleToStr(Close[1],Digits) + ", @ " + TimeToStr(TimeLocal(),TIME_SECONDS);
         DntrendAlert2 = false;
         UptrendAlert2 = true;
         DoAlerts(Msg,Subj);
      }
      if (Close[1]<Close[1+Kijun] && Close[2]>Close[2+Kijun] && !DntrendAlert2)
      {
         Subj = "Kijun crossed Price: "+Symbol()+" on M"+Period();
         Msg = "SELL Signal --- : "+Subj+ " @ "+DoubleToStr(Close[1],Digits) + ", @ " + TimeToStr(TimeLocal(),TIME_SECONDS);
         DntrendAlert2 = true;
         UptrendAlert2 = false;
         DoAlerts(Msg,Subj);
      }
   }
   return(0);
}

void DoAlerts(string msgText, string eMailSub)
{
   if (MsgAlerts) Alert(msgText);
   if (eMailAlerts) SendMail(eMailSub, msgText);
}
//+------------------------------------------------------------------+

 
Ваня:

我的个人经验与此毫无关系。

那么,传说中的石牧对你来说是陌生的?多年来,它不是已经证明了自己吗?

这不是一个交易机器人会不会损失存款的问题。

这是一个传统的石木,上面拧着一个警报。决定权在交易员手中。

你的问题是什么?

你想被返工。如果改进不是太困难,可以收费进行。但是,如果他们推荐你去Freelancer,这意味着你的改进并不小。

而进行重大修改的依据只有两个。要么交易商支付工作费用,要么提供一个真正能工作的TS。

你提供的是一个ishimoku指标--但该指标并不是一个系统。因此,没有人愿意去理会它。

 

嗯,这就对了,它在告诉你错误。

看看你自己--当控制涉及到if语句时?

在这两种情况下,这个运算符只是 "悬在空中"--这就是编译器警告你的地方。"在全球范围内不允许表达"。

if语句必须站在你希望调用警报的地方,而不是 "悬在空中"。

而且,无论是MT4还是MT5都没有区别--你在两种情况下都不能这样做。if语句将控制权传递给其中一个分支,它不能 "只是挂在空中"。

只有你的程序和函数可以 "挂在空中",在处理事件 时被终端调用--OnCalculte(),或者被你自己调用--DoAlerts()。

 
George Merts:

嗯,这就对了,它在告诉你错误。

自己看一下--当控制权来到if语句时?

在这两种情况下,这个运算符只是 "悬在空中"--这就是编译器警告你的地方。"在全球范围内不允许表达"。

if语句必须站在你希望调用警报的地方,而不是 "悬在空中"。

而且,无论是MT4还是MT5都没有区别--你在两种情况下都不能这样做。if语句将控制权传递给其中一个分支,它不能 "只是挂在空中"。

只有你的程序和函数可以 "挂在空中",在处理事件 时将被终端调用--OnCalculte(),或者被你自己调用--DoAlerts()。

我不是一个程序员

对我来说,它是一个黑暗的森林。

 
Ваня:

我不是一个程序员。

对我来说,这是一个黑暗的森林。

好吧,你被指向了自由职业者的服务。有-个活生生的程序员,他们在与你协商后形成TOR,并以类似的价格进行。

有一个论坛,他们可以帮助新手,但真正帮助那些试图成长为一个程序员的人。 相当多的交易者对此不感兴趣 - 自由职业对他们来说是非常合理的解决方案。

 
George Merts:

好吧,你被指向了自由职业者的服务。那里有一些程序员,他们会很容易地与你协商形成TOR,并以合理的价格执行它。

我已经明白mt5是一个真正的混乱。 但这是一个可以帮助初学者的论坛,但正是对那些试图成长为一个程序员的人来说。 相当多的交易者对它不感兴趣,而自由职业者对他们来说是一个非常合理的解决方案。

我只是想测试一下mt5。

我在mt4上有所有的指标。他们的工作。

由于我甚至不能舒适地测试它...

现在我明白了,mt5是一个真正的麻烦。

 
Ваня:

我只是想测试一下mt5。

在MT4上,所有的指标都在那里。他们的工作。

因为它甚至不可能舒适地测试...

现在我明白了,mt5是一个真正的麻烦。

Mt5不是一个麻烦,mql5也不是。

不过我还没有测试过这个指标。如果你有任何问题,请告诉我,我将亲自测试并寻找问题。
 
Alexey Viktorov:
Mt5以及mql5都不是什么麻烦事。只是我还没有

测试过这个指标。如果你有任何问题,请告诉我,我将亲自测试。
ArraySetAsSeries已经被遗忘。
 
o_O:
被遗忘的ArraySetAsSeries
是啊...我已经在修复它了。



现在已经修好了,检查过了。警报是有的,但我不知道它是否正确。

瓦尼亚, 请在检查后让我知道警报的正确性。该指标将在CodeBase中。
附加的文件:
 
Alexey Viktorov:
是啊...我已经在修复它了。



现在已经修好了,经过测试。警报是有的,但我不知道它是否正确。

Vanya, 请让我知道,检查后的警报是否正确。该指标将在CodeBase中。

谢谢你!好样的!愿你在余下的时间里健康和有利可图!

我将进行测试。