函數包含numericref無法使用

  •   94 
  • 最後發表   Hk  2020 五月 25
Hk 發文於   2020/05/19

函數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, 請幫忙查明問題, 感謝

 

附加文件

XQ小幫手 發文於   2020/05/25

Hi HK

相關的修正已於7.00.11/3.00.11 0414版本修正

請您點選設定-->版本更新,將版本更新到最新版本 3.00.12 (0424)版本再試試看,

謝謝您的詢問。

(p.s.)小編有測試過是可以使用的,謝謝

發表回覆
Close