請問小秘書:
指標計算有K棒數量或起始時間的限制嗎?
因為我使用 分K 寫出的指標 只能從 20171201 開始計算
你好:
指標部分除非是另外設settotalbar,預設部分是會從資料開始的K棒開始計算。
從2017/12/01開始計算,小幫手猜想,有可能是你計算公式的參數取的較長,導致從2017/12/01才開始畫。
你可以自行檢查一下,或是提供相關程式碼,供小幫手查看問題,以上說明。
未設置settotalbar?
你好:
未設置settotalbar,就是如小編所說,系統預設就是從資料開始的K棒開始計算。
但執行指標沒有從第1K開 始呀!
腳本如下:
input:T_Name("主力成本線");
variable:bar_vol(0),bar_k(0),amount(0),avg_line(0),total_amount(0),total_vol(0);
if barfreq = "Min" then bar_vol=volume;
if date[0]<>date[1] then begin
bar_k=currentbar;
amount=close*bar_vol;
avg_line=close;
end else begin
amount=close*bar_vol;
end;
total_amount=Summation(amount,currentbar-bar_k+1);
total_vol=Summation(bar_vol,currentbar-bar_k+1);
avg_line=total_amount/total_vol;
plot1(avg_line,"主力成本線");
你好:
待小幫手查看過後再向你回覆。
你好:
請按右鍵點選設定,調整XS指標計算範圍即可。

6 評論