皆さんこんにちは、

私は当初、デフォルトの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); }