CloseM 一些問題
在海期上 讀取到的數值不對月初會有問題
還要修改哪邊
Inputs:
PeriodsAgo(numericsimple),
oPeriodOpen(numericref),
oPeriodHigh(numericref),
oPeriodLow(numericref),
oPeriodClose(numericref) ;
Variables: Count(0) ;
Arrays: arr0(-1) ; // O/H/L/C
IF (PeriodsAgo > 500 or BarType > 4) Then //Only keep 500 days of records
BEgin
oPeriodOpen = -1 ;
oPeriodHigh = -1 ;
oPeriodLow = -1 ;
oPeriodClose = -1 ;
$OHLCPeriodsAgo_M = -1 ;
ENd
ELSE
BEgin
For Value1 = 1 to SessionCount(0)
begin
If Value1 < SessionCount(0) then
Value2 = Value1 + 1
else
Value2 = 1;
Condition1 = (SessionEndDayMS(Value1) = DayOfMonth(Date)) and (Time <= SessionEndTimeMS(Value1))
AND
(SessionStartDayMS(Value2) = DayOfMonth(Date)) and (Time >= SessionStartTimeMS(Value2));
//Condition1 = (Time <= SessionEndTimeMS(Value1)) AND (Time >= SessionStartTimeMS(Value2));
if Condition1 then
begin
Count = Count - 1 ;
if Count <= -1 then Count = 500;
arr0 = O ;
arr0 = H ;
arr0 = L ;
arr0 = C ;
end
else
begin
if H > arr0 then arr0 = H ;
if L < arr0 then arr0 = L ;
arr0 = C;
if PeriodsAgo = 0 then arr0 = C;
end ;
end;
oPeriodOpen = arr0 ;
oPeriodHigh = arr0 ;
oPeriodLow = arr0 ;
oPeriodClose = arr0 ;
$OHLCPeriodsAgo_M = 1 ;
ENd;
IF False THEN Value1 = $OHLCPeriodsAgo_M ;
__________
inputs: PeriodsAgo( numericsimple ) ;
variables: var1(0), var2(0), var3(0), var4(0) ;
Value1 = $OHLCPeriodsAgo_M( PeriodsAgo, var1, var2, var3, var4 ) ;
$Closem = var4 ;
頁:
[1]