腳本內有多條指標線,其中包含GetField("控盤者成本線")
但這條成本線不支援當日及分鐘頻率
試過GetField("控盤者成本線")[1],但在分鐘頻率無效
如何在腳本加以控制 GetField("控盤者成本線"),在當日收盤資料更新前和分鐘頻率下不執行(忽略這個函數)?
腳本內有多條指標線,其中包含GetField("控盤者成本線")
但這條成本線不支援當日及分鐘頻率
試過GetField("控盤者成本線")[1],但在分鐘頻率無效
如何在腳本加以控制 GetField("控盤者成本線"),在當日收盤資料更新前和分鐘頻率下不執行(忽略這個函數)?
可透過控制使用者採用的頻率控制不能使用於分鐘頻率,例如,if barFreq="Min" then return;
可透過getinfo控制盤中不採用。例如, if getinfo("isrealtime")=1 then return;
if barFreq = "Min" or getinfo("isrealtime") = 1 then return;
測試結果
1. 所有指標在分K都沒顯示,只想要成本線不顯示
2. 非盤中時間,尚不知變化
整合編寫如下是否可行?
if barFreq <> "Min" or getinfo("isrealtime") = 1 then //return;
value10=GetField("控盤者成本線");
PLot1(value10,"控盤");
Plot2(EMA(Closed(0),12),"DE12");
f barFreq <> "Min" and getinfo("isrealtime") <> 1 then
value10=GetField("控盤者成本線");
感恩!
試了盤中情況,會造成當日其他指標都無顯示NA!
請將你的程式碼貼上來看看。
setBarBack(500);
if barFreq <> "Min" or getinfo("isrealtime") <> 1 then
begin
value10=GetField("控盤者成本線");
value9=GetField("新聞聲量分數");
end;
input: HH(250,"百日高") , LL(250,"百日低");
variable: Bmid(0), Bup(0), Bdown(0);
Bup = bollingerband(Close, 20, 2);
Bmid = average(close, 20);
Bdown = bollingerband(Close, 20, -1 * 2);
value11=(Bup-Bdown);
if close > Bmid then plot24(value11,"B寬多") ;
if close > Bmid and value11 > value11[1] then plot26(value11,"B寬多漲") ;
if close < Bmid and trueAll(value11 > value11[1],2) then plot27(value11,"B寬空漲") ;
plot25(ATR(6),"ATR6");
//-------------------
var:a1(0),a2(0),a3(0),a4(0),a5(0),a6(0),a7(0),a8(0),a9(0),a10(0),a11(0),a12(0),a13(0),a14(0),a15(0),a16(0),a17(0),a18(0),a19(0);
var:i(0);
array: Arr[19,2](0);
array: strArr[19]("");
a1=round(average(getField("收盤價","W"),5),2);
a2=round(xf_EMA("w",getField("收盤價","W"),12),2) ;
a3=round(xf_EMA("W",getField("收盤價","W"),26),2) ;
a4=round(average(getField("收盤價","W"),60),2);
a5=round(average(Close,5),2);
a6=round(EMA( Close,12),2) ;
a7=round(EMA( Close,26),2) ;
a8=round(average(Close,60),2);
a9=round(high,2);
a10=round(close,2);
a11=round(low,2);
a12=round(Bup,2);
a13=round(Bmid,2);
a14=round(Bdown,2);
a15=round(highest(high,HH),2);//百日高
a16=round(Lowest(low,LL),2);
a17=round(highw(0),2);//周高
a18=round(Loww(0),2);
a19=value10;//round(GetField("控盤者成本線")[1],2);
arr[1,1]=a1;//"w5"
arr[2,1]=a2;//"wE12"
arr[3,1]=a3;//"wE26"
arr[4,1]=a4;//"w60"
arr[5,1]=a5;//"d5"
arr[6,1]=a6;//"dE12"
arr[7,1]=a7;//"dE26"
arr[8,1]=a8;//"d60"
arr[9,1]=a9;//"今高"
arr[10,1]=a10;//"今收"
arr[11,1]=a11;//"今低"
arr[12,1]=a12;//"Bup"
arr[13,1]=a13;//"Bmid"
arr[14,1]=a14;//"Bdown"
arr[15,1]=a15;//"百日高"
arr[16,1]=a16;//"百日低"
arr[17,1]=a17;//"周高"
arr[18,1]=a18;//"周低"
arr[19,1]=a19;//"控盤"
arr[1,2]=1;
arr[2,2]=2;
arr[3,2]=3;
arr[4,2]=4;
arr[5,2]=5;
arr[6,2]=6;
arr[7,2]=7;
arr[8,2]=8;
arr[9,2]=9;
arr[10,2]=10;
arr[11,2]=11;
arr[12,2]=12;
arr[13,2]=13;
arr[14,2]=14;
arr[15,2]=15;
arr[16,2]=16;
arr[17,2]=17;
arr[18,2]=18;
arr[19,2]=19;
array_sort2d(arr, 1, 19, 1, false);
for i=1 to 19
begin
switch(Arr[i,2])
begin
case 1:
strArr[i]="W5";
case 2:
strArr[i]="WE12";
case 3:
strArr[i]="WE26";
case 4:
strArr[i]="W60";
case 5:
strArr[i]="D5";
case 6:
strArr[i]="DE12";
case 7:
strArr[i]="DE26";
case 8:
strArr[i]="D60";
case 9:
strArr[i]="今高";
case 10:
strArr[i]="今收";
case 11:
strArr[i]="今低";
case 12:
strArr[i]="布林上";
case 13:
strArr[i]="布林中";
case 14:
strArr[i]="布林下";
case 15:
strArr[i]="年高";
case 16:
strArr[i]="年低";
case 17:
strArr[i]="周高";
case 18:
strArr[i]="周低";
case 19:
strArr[i]="控盤";
end;
end;
//value15=getField("漲停價", "D");
//value16=getField("跌停價", "D");
//value19=getField("控盤者成本線");
plot1(Arr[1,1],checkbox:=0);
setplotLabel(1,strArr[1]);
plot2(Arr[2,1],checkbox:=0);
setplotLabel(2,strArr[2]);
plot3(Arr[3,1],checkbox:=0);
setplotLabel(3,strArr[3]);
plot4(Arr[4,1],checkbox:=0);
setplotLabel(4,strArr[4]);
plot5(Arr[5,1],checkbox:=0);
setplotLabel(5,strArr[5]);
plot6(Arr[6,1],checkbox:=0);
setplotLabel(6,strArr[6]);
plot7(Arr[7,1],checkbox:=0);
setplotLabel(7,strArr[7]);
plot8(Arr[8,1],checkbox:=0);
setplotLabel(8,strArr[8]);
plot9(Arr[9,1],checkbox:=0);
setplotLabel(9,strArr[9]);
plot10(Arr[10,1],checkbox:=0);
setplotLabel(10,strArr[10]);
plot11(Arr[11,1],checkbox:=0);
setplotLabel(11,strArr[11]);
plot12(Arr[12,1],checkbox:=0);
setplotLabel(12,strArr[12]);
plot13(Arr[13,1],checkbox:=0);
setplotLabel(13,strArr[13]);
plot14(Arr[14,1],checkbox:=0);
setplotLabel(14,strArr[14]);
plot15(Arr[15,1],checkbox:=0);
setplotLabel(15,strArr[15]);
plot16(Arr[16,1],checkbox:=0);
setplotLabel(16,strArr[16]);
plot17(Arr[17,1],checkbox:=0);
setplotLabel(17,strArr[17]);
plot18(Arr[18,1],checkbox:=0);
setplotLabel(18,strArr[18]);
plot19(Arr[19,1],checkbox:=0);
setplotLabel(19,strArr[19]);
value254= maxList(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19);
value255=maxList2(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19);
plot20((value254-close)/close,"收離最高");
plot21((value254-high)/close,"高離最高");
value256=round(highest(high,500),2);//500高
plot22((value256-close)/close,"收離500高");
plot23(value9,"新聞聲量分數");
修改了程式,但無法上傳,被誤認為機器人。無奈!
我剛剛也是,用回文的方式才成功
程式太多行了,回文也是不行。
15 評論