小幫手您好:
我寫了下列的程式,是用主力作多成本線的指標作修正的:csv檔案裏面,3661世芯的數字是719.93,但指標的數字是845.03
input:period(40,"期數");
if barfreq = "Tick" or barfreq = "Min"
then raiseruntimeerror("不支援此頻率");
value1=GetField("主力買張");
value2=(o+h+l+c)/4;
value3=value1*value2;//做多金額
if summation(value1,period)<>0 then
value4=summation(value3,period)/summation(value1,period);
//plot1(value4,"主力作多成本線");
value5=absValue((close-value4)/value4*100);
condition1=value5<3;
if condition1 then ret = 1;
outputfield(1,close,2,"收盤價");
outputfield(2,value4,2,"短天期主力價");
outputfield(3,value5,2,"和主力價差距");

2 評論