PROFIからSUPER PROFIへの質問-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:この辺の微妙なニュアンスについて書かれている資料を教えてください。マクロは、MT5のあるビルドの発表にあったMQの唯一の例で覚えました。と##を入力すると、お手本になりました。リンク先が見つからない。 Ihor Herasko 2018.06.12 15:16 #406 fxsaber:マクロは、MT5のあるビルドの発表にあったMQの唯一の例から学びました。そこに#と##が入力され、良い例がありました。リンク先が見つからない。なるほど、いつもありがとうございます。 Dina Paches 2018.06.13 17:27 #407 Andrey Khatimlianskii:偶然が重なると...2015年のこの議論を元にまとめた公開用のincludeファイルをCodeBaseに送ったところ、https://www.mql5.com/ru/forum/63951/page2#comment_1908129。 公開用に用意したライブラリファイルのコードそのものはシンプルだ。同時に、その意味は、あなたが尋ねたとおりであり、およそセルゲイ・ディズィブリクが もたらしたものです。 後日談:結局、一番シンプルなものが一番しっくりきました。時間が経つにつれて、そのインクルードされたファイルがないと、何かが欠けているように / *いくつかの結果を出力するとき:コードを構築するとき、関数が動作する*/ことがわかりました。 fxsaber 2018.06.13 17:38 #408 fxsaber:マクロは、MT5のあるビルドの発表にあったMQの唯一の例から学びました。そこに#と##が入力され、良い例がありました。リンク先が見つかりません。 トレーディング、自動売買システム、ストラテジーテストに関するフォーラム MetaTrader 5 クライアントターミナルビルドの変更点 メタクォーツ・ソフトウェア株式会社, 2014.10.30 06:25 MetaTrader 5 build 1010プラットフォームの更新:新しいシグナル、マーケット、オプションMetaTrader 5プラットフォームのアップデートは、10月31日(金)に公開される予定です。このアップデートでは、以下の変更が行われます。MetaTrader 5 クライアントターミナル ビルド 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千を超えるシグナルをコピー 金融ニュースで金融マーケットを探索 新規登録 ログイン スペースを含まないラテン文字 このメールにパスワードが送信されます エラーが発生しました Googleでログイン WebサイトポリシーおよびMQL5.COM利用規約に同意します。 新規登録 MQL5.com WebサイトへのログインにCookieの使用を許可します。 ログインするには、ブラウザで必要な設定を有効にしてください。 ログイン/パスワードをお忘れですか? Googleでログイン
素晴らしい! 面白い方法ですね。
素晴らしい! 面白い方法ですね。
https://www.mql5.com/ru/search#!keyword=TOSTRING
https://www.mql5.com/ru/search#!keyword=TOSTRING
そう、あなたがマクロの天才であることを思い出したのです。ありがとうございます。もうひとつは、作品の説明がほとんどないことです。このような複雑な状況を説明するソースを教えてください。もちろん、C/C++の場合です。
マクロを使うのはごくまれで、簡単なレベルです。どうやら私は、不甲斐なくも彼らを放置していたようです。
この辺の微妙なニュアンスについて書かれている資料を教えてください。
マクロは、MT5のあるビルドの発表にあったMQの唯一の例で覚えました。と##を入力すると、お手本になりました。リンク先が見つからない。
マクロは、MT5のあるビルドの発表にあったMQの唯一の例から学びました。そこに#と##が入力され、良い例がありました。リンク先が見つからない。
なるほど、いつもありがとうございます。
偶然が重なると...2015年のこの議論を元にまとめた公開用のincludeファイルをCodeBaseに送ったところ、https://www.mql5.com/ru/forum/63951/page2#comment_1908129。
公開用に用意したライブラリファイルのコードそのものはシンプルだ。同時に、その意味は、あなたが尋ねたとおりであり、およそセルゲイ・ディズィブリクが もたらしたものです。
後日談:結局、一番シンプルなものが一番しっくりきました。時間が経つにつれて、そのインクルードされたファイルがないと、何かが欠けているように / *いくつかの結果を出力するとき:コードを構築するとき、関数が動作する*/ことがわかりました。
マクロは、MT5のあるビルドの発表にあったMQの唯一の例から学びました。そこに#と##が入力され、良い例がありました。リンク先が見つかりません。
トレーディング、自動売買システム、ストラテジーテストに関するフォーラム
MetaTrader 5 クライアントターミナルビルドの変更点
メタクォーツ・ソフトウェア株式会社, 2014.10.30 06:25
MetaTrader 5 build 1010プラットフォームの更新:新しいシグナル、マーケット、オプション
MetaTrader 5プラットフォームのアップデートは、10月31日(金)に公開される予定です。このアップデートでは、以下の変更が行われます。
MetaTrader 5 クライアントターミナル ビルド 1010ありがとうございます。私も同じ道を歩むことにします。
公開時間(06:25)から判断して、私は愚かにもニュースを寝坊してしまいました)))
こんにちは、私は私が必要とするすべてのレベルを持つMAインジケータを送りました。問題は、インジケータ(各MA)にマウスを合わせても、そのMAの周期が表示されないことです。どうすれば直るのか?IndicatorShortName("MASHKI =)") を変更すると、常にシンタックスエラーが発生します; 助けてください。