函數Stochastic_TSE:
SetBarMode(2);
// Stochastic function (for KD/RSV相關指標)
//
// Input: length, rsvt, kt
// Return: rsv_value, k_value, d_value
//
input:
length(numericsimple), rsvt(numericsimple), kt(numericsimple),
rsv(numericref), k(numericref), d(numericref);
variable:
maxHigh(0), minLow(0);
maxHigh = Highest(GetSymbolField("TSE.TW","最高價"), length);
minLow = Lowest(GetSymbolField("TSE.TW","最低價"), length);
if maxHigh <> minLow then
rsv = 100 * (GetSymbolField("TSE.TW","收盤價") - minLow) / (maxHigh - minLow)
else
rsv = 50;
if currentbar = 1 then
begin
k = 50;
d = 50;
end
else
begin
k = (k[1] * (rsvt - 1) + rsv) / rsvt;
d = (d[1] * (kt - 1) + k) / kt;
end;
Stochastic_TSE = 1;
編譯錯誤:
Stochastic_TSE-1-1ExitCode: 1
StdOut:
StdErr: System\XSSystem\Tmp\a1c6048f56e44eeab5f4729f20c45229.cpp: In member function 'virtual void DJScript::Function::Cbedc0a39b9e94f0280f910085cbeb5fc::OnEvalBar()':
System\XSSystem\Tmp\a1c6048f56e44eeab5f4729f20c45229.cpp:138:10: error: request for member 'Set' in '((DJScript::Function::Cbedc0a39b9e94f0280f910085cbeb5fc*)this)->DJScript::Function::Cbedc0a39b9e94f0280f910085cbeb5fc::__rsv', which is of pointer type 'SysJust::XS::IVarPrimitive<double>*' (maybe you meant to use '->' ?)
__rsv.Set(0, 50);
^
System\XSSystem\Tmp\a1c6048f56e44eeab5f4729f20c45229.cpp:142:9: error: request for member 'Set' in '((DJScript::Function::Cbedc0a39b9e94f0280f910085cbeb5fc*)this)->DJScript::Function::Cbedc0a39b9e94f0280f910085cbeb5fc::__rsv', which is of pointer type 'SysJust::XS::IVarPrimitive<double>*' (maybe you meant to use '->' ?)
{
^
System\XSSystem\Tmp\a1c6048f56e44eeab5f4729f20c45229.cpp:148:7: error: request for member 'Set' in '((DJScript::Function::Cbedc0a39b9e94f0280f910085cbeb5fc*)this)->DJScript::Function::Cbedc0a39b9e94f0280f910085cbeb5fc::_k', which is of pointer type 'SysJust::XS::IVarPrimitive<double>*' (maybe you meant to use '->' ?)
else
^
System\XSSystem\Tmp\a1c6048f56e44eeab5f4729f20c45229.cpp:149:7: error: request for member 'Set' in '((DJScript::Function::Cbedc0a39b9e94f0280f910085cbeb5fc*)this)->DJScript::Function::Cbedc0a39b9e94f0280f910085cbeb5fc::_d', which is of pointer type 'SysJust::XS::IVarPrimitive<double>*' (maybe you meant to use '->' ?)
{
^
System\XSSystem\Tmp\a1c6048f56e44eeab5f4729f20c45229.cpp:155:6: error: request for member 'Set' in '((DJScript::Function::Cbedc0a39b9e94f0280f910085cbeb5fc*)this)->DJScript::Function::Cbedc0a39b9e94f0280f910085cbeb5fc::_k', which is of pointer type 'SysJust::XS::IVarPrimitive<double>*' (maybe you meant to use '->' ?)
}
^
System\XSSystem\Tmp\a1c6048f56e44eeab5f4729f20c45229.cpp:156:6: error: request for member 'Set' in '((DJScript::Function::Cbedc0a39b9e94f0280f910085cbeb5fc*)this)->DJScript::Function::Cbedc0a39b9e94f0280f910085cbeb5fc::_d', which is of pointer type 'SysJust::XS::IVarPrimitive<double>*' (maybe you meant to use '->' ?)
_RetVal.Set(0, 1);
^
使用全球贏家版本7.00.11, 請幫忙查明問題, 感謝
1 評論