从专业人员到超级专业人员的任何问题 - 1。 - 页 41 1...343536373839404142434445 新评论 Ihor Herasko 2018.06.12 14:52 #401 Sergey Dzyublik: 很好!有趣的方法。 fxsaber 2018.06.12 14:57 #402 Ihor Herasko:很好!有趣的方法。https://www.mql5.com/ru/search#!keyword=TOSTRING Поиск - MQL5.community www.mql5.com Поиск выполняется с учетом морфологии и без учета регистра. Все буквы, независимо от того, как они введены, будут рассматриваться как строчные. По умолчанию наш поиск показывает страницы... Ihor Herasko 2018.06.12 15:01 #403 fxsaber:https://www.mql5.com/ru/search#!keyword=TOSTRING是的,我记得你是一个宏观天才。谢谢你。另一件事是,工作几乎没有任何描述。你能提供一个描述这些错综复杂情况的资料吗?当然是针对C/C++。 我很少使用宏,而且是在一个简单的水平上。显然,我一直在忽视他们,这是不应该的。 Andrey Khatimlianskii 2018.06.12 15:13 #404 谢谢你的快速和全面的答复 fxsaber 2018.06.12 15:13 #405 Ihor Herasko:你能提供一个描述这些微妙之处的资料吗?我从MQ的唯一例子中学到了宏,那是在MT5构建的一个公告中。你输入了#和##,这是个好例子。找不到链接。 Ihor Herasko 2018.06.12 15:16 #406 fxsaber:我从MQ的唯一例子中学习了宏,那是在MT5的一个构建的公告中。在那里,#和##被输入,而且有一个很好的例子。找不到链接。我明白了,再次感谢。 Dina Paches 2018.06.13 17:27 #407 Andrey Khatimlianskii:巧合发生了...我刚刚向CodeBase发送了include文件供其发表,该文件是我在2015年根据这一讨论编制的:https://www.mql5.com/ru/forum/63951/page2#comment_1908129 我为出版而准备的库文件中的代码本身很简单。同时,其意义正如你所问的那样,大约正如Sergey Dzyublik 所带来的那样 P./S.: 随着时间的推移,这是最简单的一个,对我来说变得最适用。随着时间的推移,我发现如果没有那个包含的文件--因为缺少了一些东西/*当输出一些结果时:当构建代码时,函数工作*/。 fxsaber 2018.06.13 17:38 #408 fxsaber:从MQ的唯一一个例子中学习了宏,这个例子是在MT5构建的一个公告中。在那里输入了#和##,并且有一个很好的例子。我找不到这个链接。 关于交易、自动交易系统和策略测试的论坛 MetaTrader 5客户终端构建的变化 MetaQuotes软件公司。, 2014.10.30 06:25 MetaTrader 5 build 1010平台更新:新信号、市场和选项MetaTrader 5平台的更新将于10月31日星期五发布。该更新将包含以下变化。MetaTrader 5客户终端build 1010MQL5:增加了宏参数转换为字符串和宏参数连接的功能。下面是一个例子,通过宏连接可以组织自动删除类实例。 //+------------------------------------------------------------------+ //| MacroExample | //| Copyright 2014, MetaQuotes Software Corp. | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property script_show_inputs input bool InpSecond=true; #define DEFCLASS(class_name) class class_name:public CBase{public:class_name(string name):CBase(name){}}; #define TOSTR(x) #x #define AUTODEL(obj) CAutoDelete auto_##obj(obj) #define NEWOBJ(type,ptr) do { ptr=new type(TOSTR(ptr)); \ Print("Create object '",TOSTR(type)," ",TOSTR(ptr),"' by macro NEWOBJ"); } \ while(0) //+------------------------------------------------------------------+ //| Базовый класс, необходим для автоудаления объектов | //+------------------------------------------------------------------+ class CBase { protected: string m_name; public: CBase(string name):m_name(name) { } string Name(void) const{ return(m_name); } }; //+------------------------------------------------------------------+ //| Класс автоудаления объектов позволяет не следить за созданными | //| объектами. Он удаляет их в своем деструкторе | //+------------------------------------------------------------------+ class CAutoDelete { CBase *m_obj; public: CAutoDelete(CBase *obj):m_obj(obj) { } ~CAutoDelete() { if(CheckPointer(m_obj)==POINTER_DYNAMIC) { Print("Delete object '",m_obj.Name(),"' by CAutoDelete class"); delete m_obj; } } }; //+------------------------------------------------------------------+ //| Объявим два новых класса CFoo и CBar | //+------------------------------------------------------------------+ DEFCLASS(CFoo); DEFCLASS(CBar); //+------------------------------------------------------------------+ //| Основная функция скрипта | //+------------------------------------------------------------------+ void OnStart() { CFoo *foo; //--- создадим объект класса CFoo NEWOBJ(CFoo,foo); //--- создадим экземпляр класса автоудаления объекта CFoo foo AUTODEL(foo); //--- if(InpSecond) { CBar *bar; //--- NEWOBJ(CBar,bar); AUTODEL(bar); } //--- Удалять foo не нужно, он будет удален автоматически } //+------------------------------------------------------------------+ Ihor Herasko 2018.06.13 17:52 #409 fxsaber: 谢谢你。我也会走同样的路。 从出版时间(06:25)来看,我愚蠢地睡过了头,新闻)))。 swanhearts 2018.07.21 10:40 #410 你好,我收到了一个MA指标,上面有我需要的所有级别。问题是,当我把鼠标悬停在指标(每个MA)上时,它并不显示该MA的周期。如何解决这个问题?在改变IndicatorShortName("MASHKI =)") 时不断出现语法错误;请帮助。 //+------------------------------------------------------------------+ //| ManyMA.mq4 | //| VVM | //| | //+------------------------------------------------------------------+ #property copyright "VVM" #property indicator_chart_window #property indicator_buffers 8 #property indicator_color1 Gold #property indicator_color2 Aqua #property indicator_color3 Blue #property indicator_color4 Magenta #property indicator_color5 Red #property indicator_color6 Green #property indicator_color7 BurlyWood #property indicator_color8 DarkViolet extern int MA1_Period=8; extern int MA1_Shift=0; extern int MA1_Method=1; extern int MA2_Period=13; extern int MA2_Shift=0; extern int MA2_Method=0; extern int MA3_Period=21; extern int MA3_Shift=0; extern int MA3_Method=1; extern int MA4_Period=50; extern int MA4_Shift=0; extern int MA4_Method=1; extern int MA5_Period=50; extern int MA5_Shift=0; extern int MA5_Method=0; extern int MA6_Period=100; extern int MA6_Shift=0; extern int MA6_Method=0; extern int MA7_Period=200; extern int MA7_Shift=0; extern int MA7_Method=0; extern int MA8_Period=350; extern int MA8_Shift=0; extern int MA8_Method=1; extern int MA9_Period=1000; extern int MA9_Shift=0; extern int MA9_Method=0; double ExtMapBuffer1[]; double ExtMapBuffer2[]; double ExtMapBuffer3[]; double ExtMapBuffer4[]; double ExtMapBuffer5[]; double ExtMapBuffer6[]; double ExtMapBuffer7[]; double ExtMapBuffer8[]; double ExtMapBuffer9[]; int ExtCountedBars=0; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { int draw_begin1; int draw_begin2; int draw_begin3; int draw_begin4; int draw_begin5; int draw_begin6; int draw_begin7; int draw_begin8; int draw_begin9; string short_name; SetIndexStyle(0, DRAW_LINE, 0, 2); SetIndexStyle(1, DRAW_LINE, 0, 2); SetIndexStyle(2, DRAW_LINE, 0, 2); SetIndexStyle(3, DRAW_LINE, 0, 2); SetIndexStyle(4, DRAW_LINE, 0, 2); SetIndexStyle(5, DRAW_LINE, 0, 3); SetIndexStyle(6, DRAW_LINE, 0, 3); SetIndexStyle(7, DRAW_LINE, 0, 3); SetIndexStyle(8, DRAW_LINE, 0, 4); SetIndexShift(0, MA1_Shift); SetIndexShift(1, MA2_Shift); SetIndexShift(2, MA3_Shift); SetIndexShift(3, MA4_Shift); SetIndexShift(4, MA5_Shift); SetIndexShift(5, MA6_Shift); SetIndexShift(6, MA7_Shift); SetIndexShift(7, MA8_Shift); SetIndexShift(8, MA9_Shift); IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)); draw_begin1=MA1_Period-1; draw_begin2=MA2_Period-1; draw_begin3=MA3_Period-1; draw_begin4=MA4_Period-1; draw_begin5=MA5_Period-1; draw_begin6=MA6_Period-1; draw_begin7=MA7_Period-1; draw_begin8=MA8_Period-1; draw_begin9=MA9_Period-1; IndicatorShortName("MASHKI =)"); SetIndexDrawBegin(0,draw_begin1); SetIndexDrawBegin(1,draw_begin2); SetIndexDrawBegin(2,draw_begin3); SetIndexDrawBegin(3,draw_begin4); SetIndexDrawBegin(4,draw_begin5); SetIndexDrawBegin(5,draw_begin6); SetIndexDrawBegin(6,draw_begin7); SetIndexDrawBegin(7,draw_begin8); SetIndexDrawBegin(8,draw_begin9); SetIndexBuffer(0,ExtMapBuffer1); SetIndexBuffer(1,ExtMapBuffer2); SetIndexBuffer(2,ExtMapBuffer3); SetIndexBuffer(3,ExtMapBuffer4); SetIndexBuffer(4,ExtMapBuffer5); SetIndexBuffer(5,ExtMapBuffer6); SetIndexBuffer(6,ExtMapBuffer7); SetIndexBuffer(7,ExtMapBuffer8); SetIndexBuffer(8,ExtMapBuffer9); return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { ExtCountedBars=IndicatorCounted(); if (ExtCountedBars<0) return(-1); if (ExtCountedBars>0) ExtCountedBars--; switch(MA1_Method) { case 0 : sma(1, MA1_Period); break; case 1 : ema(1, MA1_Period); } switch(MA2_Method) { case 0 : sma(2, MA2_Period); break; case 1 : ema(2, MA2_Period); } switch(MA3_Method) { case 0 : sma(3, MA3_Period); break; case 1 : ema(3, MA3_Period); } switch(MA4_Method) { case 0 : sma(4, MA4_Period); break; case 1 : ema(4, MA4_Period); } switch(MA5_Method) { case 0 : sma(5, MA5_Period); break; case 1 : ema(5, MA5_Period); } switch(MA6_Method) { case 0 : sma(6, MA6_Period); break; case 1 : ema(6, MA6_Period); } switch(MA7_Method) { case 0 : sma(7, MA7_Period); break; case 1 : ema(7, MA7_Period); } switch(MA8_Method) { case 0 : sma(8, MA8_Period); break; case 1 : ema(8, MA8_Period); } switch(MA9_Method) { case 0 : sma(9, MA9_Period); case 1 : ema(9, MA9_Period); } return(0); } void sma(int MAnum, int MA_period) { double sum=0; int i,pos=Bars-ExtCountedBars-1; //---- initial accumulation if(pos<MA_period) pos=MA_period; for(i=1;i<MA_period;i++,pos--) sum+=Close[pos]; //---- main calculation loop while(pos>=0) { sum+=Close[pos]; switch(MAnum) { case 1 : ExtMapBuffer1[pos]=sum/MA_period; break; case 2 : ExtMapBuffer2[pos]=sum/MA_period; break; case 3 : ExtMapBuffer3[pos]=sum/MA_period; break; case 4 : ExtMapBuffer4[pos]=sum/MA_period; break; case 5 : ExtMapBuffer5[pos]=sum/MA_period; break; case 6 : ExtMapBuffer6[pos]=sum/MA_period; break; case 7 : ExtMapBuffer7[pos]=sum/MA_period; break; case 8 : ExtMapBuffer8[pos]=sum/MA_period; break; case 9 : ExtMapBuffer9[pos]=sum/MA_period; } sum-=Close[pos+MA_period-1]; pos--; } //---- zero initial bars if(ExtCountedBars<1) switch(MAnum) { case 1 : for(i=1;i<MA_period;i++) ExtMapBuffer1[Bars-i]=0; break; case 2 : for(i=1;i<MA_period;i++) ExtMapBuffer2[Bars-i]=0; break; case 3 : for(i=1;i<MA_period;i++) ExtMapBuffer3[Bars-i]=0; break; case 4 : for(i=1;i<MA_period;i++) ExtMapBuffer4[Bars-i]=0; break; case 5 : for(i=1;i<MA_period;i++) ExtMapBuffer5[Bars-i]=0; break; case 6 : for(i=1;i<MA_period;i++) ExtMapBuffer6[Bars-i]=0; break; case 7 : for(i=1;i<MA_period;i++) ExtMapBuffer7[Bars-i]=0; break; case 8 : for(i=1;i<MA_period;i++) ExtMapBuffer8[Bars-i]=0; break; case 9 : for(i=1;i<MA_period;i++) ExtMapBuffer9[Bars-i]=0; } } void ema(int MAnum, int MA_Period) { double pr=2.0/(MA_Period+1); int pos=Bars-2; if(ExtCountedBars>2) pos=Bars-ExtCountedBars-1; //---- main calculation loop while(pos>=0) { switch(MAnum) { case 1 : if(pos==Bars-2) ExtMapBuffer1[pos+1]=Close[pos+1]; break; case 2 : if(pos==Bars-2) ExtMapBuffer2[pos+1]=Close[pos+1]; break; case 3 : if(pos==Bars-2) ExtMapBuffer3[pos+1]=Close[pos+1]; break; case 4 : if(pos==Bars-2) ExtMapBuffer4[pos+1]=Close[pos+1]; break; case 5 : if(pos==Bars-2) ExtMapBuffer5[pos+1]=Close[pos+1]; break; case 6 : if(pos==Bars-2) ExtMapBuffer6[pos+1]=Close[pos+1]; break; case 7 : if(pos==Bars-2) ExtMapBuffer7[pos+1]=Close[pos+1]; break; case 8 : if(pos==Bars-2) ExtMapBuffer8[pos+1]=Close[pos+1]; break; case 9 : if(pos==Bars-2) ExtMapBuffer9[pos+1]=Close[pos+1]; } switch(MAnum) { case 1 : ExtMapBuffer1[pos]=Close[pos]*pr+ExtMapBuffer1[pos+1]*(1-pr); break; case 2 : ExtMapBuffer2[pos]=Close[pos]*pr+ExtMapBuffer2[pos+1]*(1-pr); break; case 3 : ExtMapBuffer3[pos]=Close[pos]*pr+ExtMapBuffer3[pos+1]*(1-pr); break; case 4 : ExtMapBuffer4[pos]=Close[pos]*pr+ExtMapBuffer4[pos+1]*(1-pr); break; case 5 : ExtMapBuffer5[pos]=Close[pos]*pr+ExtMapBuffer5[pos+1]*(1-pr); break; case 6 : ExtMapBuffer6[pos]=Close[pos]*pr+ExtMapBuffer6[pos+1]*(1-pr); break; case 7 : ExtMapBuffer7[pos]=Close[pos]*pr+ExtMapBuffer7[pos+1]*(1-pr); break; case 8 : ExtMapBuffer8[pos]=Close[pos]*pr+ExtMapBuffer8[pos+1]*(1-pr); break; case 9 : ExtMapBuffer9[pos]=Close[pos]*pr+ExtMapBuffer9[pos+1]*(1-pr); } pos--; } } 1...343536373839404142434445 新评论 您错过了交易机会: 免费交易应用程序 8,000+信号可供复制 探索金融市场的经济新闻 注册 登录 拉丁字符(不带空格) 密码将被发送至该邮箱 发生错误 使用 Google 登录 您同意网站政策和使用条款 如果您没有帐号,请注册 可以使用cookies登录MQL5.com网站。 请在您的浏览器中启用必要的设置,否则您将无法登录。 忘记您的登录名/密码? 使用 Google 登录
很好!有趣的方法。
很好!有趣的方法。
https://www.mql5.com/ru/search#!keyword=TOSTRING
https://www.mql5.com/ru/search#!keyword=TOSTRING
是的,我记得你是一个宏观天才。谢谢你。另一件事是,工作几乎没有任何描述。你能提供一个描述这些错综复杂情况的资料吗?当然是针对C/C++。
我很少使用宏,而且是在一个简单的水平上。显然,我一直在忽视他们,这是不应该的。
你能提供一个描述这些微妙之处的资料吗?
我从MQ的唯一例子中学到了宏,那是在MT5构建的一个公告中。你输入了#和##,这是个好例子。找不到链接。
我从MQ的唯一例子中学习了宏,那是在MT5的一个构建的公告中。在那里,#和##被输入,而且有一个很好的例子。找不到链接。
我明白了,再次感谢。
巧合发生了...我刚刚向CodeBase发送了include文件供其发表,该文件是我在2015年根据这一讨论编制的:https://www.mql5.com/ru/forum/63951/page2#comment_1908129
我为出版而准备的库文件中的代码本身很简单。同时,其意义正如你所问的那样,大约正如Sergey Dzyublik 所带来的那样
P./S.: 随着时间的推移,这是最简单的一个,对我来说变得最适用。随着时间的推移,我发现如果没有那个包含的文件--因为缺少了一些东西/*当输出一些结果时:当构建代码时,函数工作*/。
从MQ的唯一一个例子中学习了宏,这个例子是在MT5构建的一个公告中。在那里输入了#和##,并且有一个很好的例子。我找不到这个链接。
关于交易、自动交易系统和策略测试的论坛
MetaTrader 5客户终端构建的变化
MetaQuotes软件公司。, 2014.10.30 06:25
MetaTrader 5 build 1010平台更新:新信号、市场和选项
MetaTrader 5平台的更新将于10月31日星期五发布。该更新将包含以下变化。
MetaTrader 5客户终端build 1010谢谢你。我也会走同样的路。
从出版时间(06:25)来看,我愚蠢地睡过了头,新闻)))。
你好,我收到了一个MA指标,上面有我需要的所有级别。问题是,当我把鼠标悬停在指标(每个MA)上时,它并不显示该MA的周期。如何解决这个问题?在改变IndicatorShortName("MASHKI =)") 时不断出现语法错误;请帮助。