如何使用在1分K

  •   181 
  • 最後發表   jam0209  2023 六月 01
jam0209 發文於   2023/05/28

想問一下這個語法是否可以用在1分K

input:Length(20); setinputname(1,"下降趨勢計算期數"); 

input:Rate(150); setinputname(2,"反轉率%"); 

variable: Factor(0); 

 

settotalbar(Length + 3); 

 

 

Factor = 100/Close[Length]; 

 

value1 = linearregslope(high*Factor,Length); 

value2 = linearregslope(high*Factor,3); 

 

if close > open and close < close[length]  and  value1 < 0 and value2-value1 > Rate*0.01 then ret=1; 

input:short1(5,"短期平均"),mid1(20,"長期平均"); 

 

//透過Z的時間安排來決定現在用的是那一根Bar的資料  

variable: Z(0); 

if currenttime > 180000  

or currenttime < 083000 then  

Z =0  

else  

Z=1; 

 

value1=GetField("內盤量");//內盤量 

value2=GetField("外盤量");//外盤量 

value3=value1+value2; 

 

if value3<>0 then value4=value2/value3*100; 

//外盤比重 

 

value5=average(value4,short1); 

value6=average(value4,mid1); 

 

if close*1.4<close[90] 

and value5 crosses above value6  

and value4>60 

and average(volume,100)>1000 

and tselsindex(10,6)[Z]=1 

then ret=1; 

XQ小幫手 發文於   2023/06/01

 Hello jam0209,

 

小幫手沒看到腳本裡面有使用到不能使用在分鐘頻率的欄位,所以是可以使用在1分鐘頻率上的。

需注意回測時1分鐘頻率不能夠使用逐筆洗價 (內盤量和外盤量欄位不支援)。

若有疑慮的話可以將數值print出來檢查。

發表回覆
Close