Custom Indicator Development: Specifications for iTime and iBarShift
Thank you for your continued support.
I have a question regarding the specifications of functions used in custom indicator development.
When retrieving the bar time using `Time()` or `iTime()`, it appears possible to retrieve it in either project time or UTC, but what time format is actually stored internally for each bar?
Is it based on the “Bar Time Format” set when creating the project?
Is it not possible to retrieve the time based on the “Bar Time Format” using Time() or iTime()?
Also, for example, if the “Bar Time Format” is set to “Auto” and the bar time is based on the end of the New York session, when searching for bars using the iBarShift() function, which time format is used for the search: “Project Time,” “UTC,” or “the time based on the Bar Time Format”?
I’m having trouble using iBarShift() on 4-hour or longer timeframes because it doesn’t seem to search for bars based on the “bar time format.”
Thank you in advance.
- How does this impact your experience?
Comments2
Stanislav Voitsekhovskyi
Aug 2
こんにちは @Masato Isobe
お問い合わせいただき、ありがとうございます。
この件については、すでに当社の開発チームに伝達いたしました。回答が寄せられ次第、すぐにご連絡いたします。
ご協力ありがとうございます!
Stanislav Voitsekhovskyi
Aug 3
お待ちいただきありがとうございます @Masato Isobe
開発チームに確認いたしました。
Forex Tester Onlineでは、すべてのバーは内部的に UTC+0 で保存されています。その後、プロジェクトの設定に応じて表示時間へ変換されます。
例えば、
this.api.Time(index, TimeZoneMode.PROJECT)を使用した場合、プラットフォーム上で表示されているバーの時刻が取得されます。なお、Time()メソッドのデフォルトはTimeZoneMode.PROJECTです。また、
iBarShift()は内部で時刻を UTC に変換して処理しています。そのため、渡す時刻が指定したタイムゾーン(TimeZoneMode.PROJECTまたはTimeZoneMode.UTC)でバーの時刻と一致していれば、どちらの場合でも正しく検索できる仕様です。一方で、4時間足以上の上位タイムフレームにおいて
iBarShift()に不具合があることを開発チームでも確認しております。この問題はすでに修正済みで、次回リリースで反映される予定です。___
Thank you for your patience.
I checked this with our developers.
In Forex Tester Online, all bars are stored internally in UTC+0. They are then converted to the appropriate time according to your project settings.
For example, when you use
this.api.Time(index, TimeZoneMode.PROJECT), you receive the same bar time that is displayed in the platform. The default mode for theTime()method isTimeZoneMode.PROJECT.The
iBarShift()method internally converts everything to UTC before processing. Therefore, it should correctly handle bothTimeZoneMode.PROJECTandTimeZoneMode.UTC, provided that the time you pass matches the bar time in the selected time zone.Regarding your issue on 4-hour and higher timeframes, our developers confirmed that there was indeed a bug in
iBarShift(). It has already been fixed internally, and the fix will be included in the next release.