大家好,雷達撰寫急拉相關條件,條件如下:
1) 急拉前的總量不超過5日均量,急拉後會開始出量。
2) 急拉之後的最低價不會比急拉前的最高價還低。
3) 最後收盤會漲>3%。
ps:急拉都是發生在11點過後。
這裡比較常碰到的問題就是要怎麼在急拉分水嶺去做紀錄的動作,
故撰寫範例警示腳本供大家參考,附檔雷達範例匯出檔案一併提供給大家,
撰寫邏輯腳本註解中如下,以上供參考:
input:_RapidTime(110000,"HHMMSS急拉時間"),_MAVolLen(5,"N日均量"),_LimitReward(3,"最後收盤漲N%");
var:_recordVol(0),_recordL(0),_recordH(0),_MAVol(0);
if barfreq <> "Min" then RaiseRuntimeError("請設定分鐘頻率");
//_recordVol紀錄「急拉前的總量」
//_recordH紀錄「急拉前的最高價」
if time <= _RapidTime then begin
_recordVol = GetField("成交量", "D");
_recordH = GetField("最高價", "D");
end;
//_recordL紀錄「急拉後的最低價」
if time > _RapidTime and _recordL = 0 then _recordL = close
else if time > _RapidTime and _recordL <> 0 and close < _recordL then _recordL = close;
//交易日更新後,初始化每天的紀錄變數
if getfieldDate("date") <> getfieldDate("date")[1] then begin
_recordVol = 0;
_recordH = 0;
_recordL = 0;
end;
//_MAVol是N日均量
_MAVol = average(GetField("成交量", "D"), _MAVolLen);
//1) 急拉前的總量不超過5日均量,急拉後會開始出量。
condition1 = _recordVol <= _MAVol and time > _RapidTime and GetField("成交量", "D") > _MAVol;
//2) 急拉之後的最低價不會比急拉前的最高價還低。
condition2 = time > _RapidTime and _recordL >= _recordH;
//3) 最後收盤會漲>3%。收盤時間為 132000 以後。
condition3 = time > 132000 and rateOfChange(GetField("收盤價", "D"),1) > _LimitReward * 0.01;
//ps:急拉都是發生在11點過後。
if condition1 and condition2 and condition3 then ret = 1;
{//驗證數據
print(date,time,_recordVol, GetField("成交量", "D"),_MAVol,_recordL,_recordH,rateOfChange(GetField("收盤價", "D"),1),_LimitReward);}
3 評論