昨天分享股票的盤中大戶散戶指標之後,有不少網友希望也提供期指專用的盤中大戶散戶指標,我試著拿昨天的腳本改了一下,不曉得符不符合大家的需求
首先還是先PO腳本
input: bos(true,"類別",inputkind:=dict(["大戶",true],["散戶",false]),quickedit:=true), p(50,"大戶門檻(口數)");//預設值先訂50口,大家可以改成自己的定義 variable:i(0),tv(0),tp1(0),tp(0); i=0; if date<>date[1] then begin //當天開盤開始從新起算 value1=0; value2=0; end; if V>0 then begin while GetField("時間","Tick")[i]>=time and GetFieldDate("成交量","Tick")[i]=getfield("日期", "D") i+=1; while i>0 begin i-=1; //做一個從這一根往前算到開盤共幾根的計數器 tv=GetField("成交量","Tick")[i]; tp=GetField("收盤價","Tick")[i]; tp1=GetField("收盤價","Tick")[i+1]; condition1=tv>=p;//設定符合大戶的口數門檻 if tp>tp1 //分上漲及下跌時的情況,這裡沒有考慮平盤的口數 then begin condition2=true; condition3=false; end; if tp<tp1 then begin condition2=false; condition3=true; end; if condition1 then begin if condition2 then value1+=tv;//計算累積的大戶量 if condition3 then value1-=tv; end else begin if condition2 then value2+=tv;//計算累積的非大戶量 if condition3 then value2-=tv; end; end; end; if bos then value3=value1 else value3=value2; if value3>=0 then plot1(value3,"大戶買賣超"); if value3<0 then plot2(value3,"大戶買賣超"); if not bos then begin setplotlabel(1,"散戶買賣超"); setplotlabel(2,"散戶買賣超"); end;
用這腳本畫出來的畫面如下,我用的是一分鐘線,然後大戶的門檻是單筆50口
這一頁的下載點如下
如果是直接複製上述腳本的朋友,繪圖的設定如下
請記得到技術分析設定視窗中把XS指標計算範圍改成如下圖
我把頻率改成用五分鐘線
要改大戶的門檻 可以在下圖這地方更改
以上是我修改的內容,不曉得有沒有符合網友的需求?