//+------------------------------------------------------------------+//| SignalRSI.mqh |//| Copyright 2009-2013, MetaQuotes Software Corp. |//| http://www.mql5.com |//+------------------------------------------------------------------+
#include <Expert\ExpertSignal.mqh>
// wizard description start//+------------------------------------------------------------------+//| Description of the class |//| Title=Signals of oscillator 'Relative Strength Index' |//| Type=SignalAdvanced |//| Name=Relative Strength Index |//| ShortName=RSI |//| Class=CSignalRSI |//| Page=signal_rsi |//| Parameter=PeriodRSI,int,8,Period of calculation |//| Parameter=Applied,ENUM_APPLIED_PRICE,PRICE_CLOSE,Prices series |//| Parameter=Intervals,int,1,Type of intervals |//+------------------------------------------------------------------+// wizard description end//+------------------------------------------------------------------+//| Class CSignalRSI. |//| Purpose: Class of generator of trade signals based on |//| the 'Relative Strength Index' oscillator. |//| Is derived from the CExpertSignal class. |//+------------------------------------------------------------------+class CSignalRSI : public CExpertSignal
{
protected:
CiRSI m_rsi; // object-oscillator//--- adjusted parametersint m_periodRSI; // the "period of calculation" parameter of the oscillator
ENUM_APPLIED_PRICE m_applied; // the "prices series" parameter of the oscillatorint m_intervals; ////--- "weights" of market models (0-100)int m_pattern_0; // model 0 "the oscillator has required direction"int m_pattern_1; // model 1 "reverse behind the level of overbuying/overselling"int m_pattern_2; // model 2 "failed swing"int m_pattern_3; // model 3 "divergence of the oscillator and price"int m_pattern_4; // model 4 "double divergence of the oscillator and price"int m_pattern_5; // model 5 "head/shoulders"//--- variablesdouble m_extr_osc[10]; // array of values of extremums of the oscillatordouble m_extr_pr[10]; // array of values of the corresponding extremums of priceint m_extr_pos[10]; // array of shifts of extremums (in bars)uint m_extr_map; // resulting bit-map of ratio of extremums of the oscillator and the pricepublic:
CSignalRSI(void);
~CSignalRSI(void);
//--- methods of setting adjustable parametersvoid PeriodRSI(intvalue) { m_periodRSI=value; }
void Applied(ENUM_APPLIED_PRICE value) { m_applied=value; }
void Intervals(intvalue) { m_intervals=value; }//--- methods of adjusting "weights" of market modelsvoid Pattern_0(intvalue) { m_pattern_0=value; }
ここでは、シグナルモジュールを選択し、パラメータをプレビューすると、最後のパラメータが表示されますが、最後のパラメータは表示されません(エラー、コンパイル警告もありません)。
何もはっきりしていない。カラー」ツールでテキストをハイライトしてみる
そうしないと、どれが「最後から二番目のパラメータ」でどれが「最後」なのかがわからなくなります。
トリガーしない行をハイライト表示。
解決方法は次の通りです。Signalsモジュールで
MQL5 Wizardで 生成されたExpert Advisorで。
ボトムライン
では、シグナルモジュールの記述で、入力パラメータをenumで指定することはできないのでしょうか?
返信」ボタンが押しにくい?誰に向かって、どんな質問をしているのかを明確にするため?
だから、書き込みが次から次へとあって、それが前の書き込みに対する返答であることがすでに明らかで、余計な引用を使うことはすでに引用のし過ぎです。
対話から離れる。空中で、つまり誰に対しても問いかけ続ける。
対話から離れる。空に向かって、つまり誰に向かっても問いかけ続ける。
では、答えはないのですか?みんなに質問です。
さて、enumを使った入力パラメータは、信号モジュールの記述で直接指定することはできないのでしょうか?
どこに例があるのか、教えていただけませんか?
シグナルモジュールのどこに、入力パラメータのコードを列挙として挿入 するか、それによって、そのモジュールの記述子で指定することができるようにします。
enum ENUM_AVAILABLE_POSITIONS { LONG_POSITION, SHORT_POSITION, BOTH_POSITION };