datetime Time[ ]
Series array that contains open time of each bar of the current chart. Data like datetime represent time, in seconds, that has passed since 00:00 a.m. of 1 January, 1970.
現在チャートのそれぞれのバーの開始時間を含んでいる直列配列です。1970年1月1日 午前0:00からの経過した時間(秒)を datetime
型で表したデータです。
Series array elements are indexed in the reverse order, i.e., from the
last one to the first one. The current bar which is the last in the array
is indexed as 0. The oldest bar, the first in the chart, is indexed as
Bars-1.
直列配列の要素は、逆の順序でインデックスされています。すなわち、最後の1つから最初の1つへ向けて作成されます。配列で最後の現在のバーは 0
としてインデックス付けされます。最も古いバー、チャートの最初は、Bars-1 でインデックス付けされます。
参照 iTime()
Sample:
サンプル:
for(i=Bars-2; i>=0; i--)
{
if(High[i+1] > LastHigh) LastHigh = High[i+1];
if(Low[i+1] < LastLow) LastLow = Low[i+1];
//----
if(TimeDay(Time[i]) != TimeDay(Time[i+1]))
{
P = (LastHigh + LastLow + Close[i+1])/3;
R1 = P*2 - LastLow;
S1 = P*2 - LastHigh;
R2 = P + LastHigh - LastLow;
S2 = P - (LastHigh - LastLow);
R3 = P*2 + LastHigh - LastLow*2;
S3 = P*2 - (LastHigh*2 - LastLow);
LastLow = Open[i];
LastHigh = Open[i];
}
//----
PBuffer[i] = P;
S1Buffer[i] = S1;
R1Buffer[i] = R1;
S2Buffer[i] = S2;
R2Buffer[i] = R2;
S3Buffer[i] = S3;
R3Buffer[i] = R3;
}
|