他のインジケーターの値を表示するカスタムインジケーター
Results 1 to 3 of 3

Thread: 他のインジケーターの値を表示するカスタムインジケーター

  1. #1
    皆さんこんにちは、

    私は当初、デフォルトのRSIインジケーターコードを編集して、現在のチャートに別の通貨ペアのRSI値を表示しようとしていました。しかし、それがわからなかったので、回避策を試しています。別のペアからRSIインジケーターを読み取るだけのカスタムインジケーターを作成しようとしています。

    これが私のコードですが、正しく機能しません。
    表示される値は約2〜5ずれており、バックテストすると正しい値が表示されません。
    ヘルプとポインタを本当にいただければ幸いです。

    挿入されたコード// --------------------------------------------- --------------------- /| Test.mq4 |/| Copyright 2020、MetaQuotes Software Corp. |/| https://www.mql5.com |/ ----------------------------------------------- ------------------- #property copyright Copyright 2020、MetaQuotes Software Corp. #property link https://www.mql5.com #property version 1.00 #property strict#プロパティindior_level130.0 #property Indior_level2 70.0 #property Indior_separate_window #property Indior_minimum 0 #property Indior_maximum 100 #property Indior_buffers 1 #property Indior_plots 1/--- plot one #property Indior_label1 Eur #property Indior_type1 DRAW_LINE #proper_プロパティindior_width11 extern int num = 4;/---インジケーターバッファdoubleEurBuffer#91;#93 ;;/ ----------------------------------------------- ------------------- /|カスタムインジケーター初期化関数|/ ----------------------------------------------- ------------------- int OnInit(){//---インジケーターバッファーマッピングSetIndexBuffer(0、EurBuffer);/--- return(INIT_SUCCEEDED); }/ ---------------------------------------------- -------------------- /|カスタムインジケーター反復関数|/ ----------------------------------------------- ------------------- int OnCalculate(const int rate_total、const int prev_calculated、const datetime time#91;#93;、const double open#91;#93; 、const double high#91;#93;、const double low#91;#93;、const double close#91;#93;、const long tick_volume#91;#93;、const long volume#91;#93; 、const int Spread#91;#93;){//--- int uncalculatedBar = rate_total --prev_calculated; for(int i = 0; ilt; uncalculatedBar; i ){EurBuffer#91; i#93; = Calc(i、EURUSD); }/---次の呼び出しのためにprev_calculatedの戻り値return(rates_total); }/ ---------------------------------------------- -------------------- double Calc(int pos、string pair){double Str = iRSI(pair、60,5、PRICE_CLOSE、pos); return(Str); }

  2. #2

    Quote Originally Posted by ;
    ...ヘルプとポインタを本当にいただければ幸いです...
    パラメータrates_totalおよびprev_calculatedは、現在のチャート期間と組み合わせてのみ使用できます。ただし、常にPERIOD_H1を使用してiRSI()を呼び出すと、それが問題の原因になります。現在のチャートがH1期間でない場合は常に、ループはナンセンスを生成します。それがあなたが経験することです。

  3. #3

    Quote Originally Posted by ;
    みなさん、こんにちは。私は当初、デフォルトのRSIインジケーターコードを編集して、現在のチャートに別の通貨ペアのRSI値を表示しようとしていました。しかし、それがわからなかったので、回避策を試しています。別のペアからRSIインジケーターを読み取るだけのカスタムインジケーターを作成しようとしています。これが私のコードですが、正しく機能しません。表示される値は約2〜5ずれており、バックテストすると正しい値が表示されません。ヘルプとポインタを本当にいただければ幸いです。/ ----------------------------------------------- ------------------- ..。
    ループで以下を試してください。挿入されたコードintshift = iBarShift(EURUSD、60、Time#91; i#93;); EurBuffer#91; i#93; = Calc(shift、EURUSD);

投稿権限

  • Youma新しいスレッドを投稿しない
  • Youmaは返信しない
  • あなたは添付ファイルを投稿しないかもしれない
  • Youma Notedityourposts
  •  
  • スマイリーはオンです
  • スマイリーはオンです
  • [IMG]コードがオンです
  • [VIDEO]コードがオンです
  • HTMLコードがオフです
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.