int iBarShift(string symbol, int timeframe, datetime time, bool exact=false)
Search for bar by open time. The function returns bar shift with the open
time specified. If the bar having the specified open time is missing, the
function will return -1 or the nearest bar shift depending on the exact.
開始時間でバーを検索します。この関数は、指定された開始時間のバーの変移値を返します。もし、指定された開始時間のバーが見つからない場合、この関数は、-1
を返すか、exact の値によっては、最も近いバーの変移値を返します。
Parameters:
パラメータ:
| symbol |
- |
Symbol the data of which should be used to calculate indicator.
NULL means the current symbol. インディケータの計算に使用するデータの通貨ペア名。NULL
は、現在のシンボルを意味します。 |
| timeframe |
- |
時間枠。時間枠の列挙値のいずれかを指定できます。0
は、現在のチャートの時間枠を意味します。 |
| time |
- |
value to find (bar's open time).
検索する値(バーの開始時間) |
| exact |
- |
Return mode when bar not found. false - iBarShift returns nearest. true - iBarShift returns -1. バーが見つからない場合の戻り値のモード。false - iBarShift は最も近いものを返します。ture - iBarShiftは -1 を返します。 |
|
Sample:
サンプル:
datetime some_time=D'2004.03.21 12:00';
int shift=iBarShift("EUROUSD",PERIOD_M1,some_time);
Print("shift of bar with open time ",TimeToStr(some_time)," is ",shift);
|