請問這樣寫能在9點05分製造出一個開盤強勢股的檔案嗎?同時如何自動放入自選股報價?如果不行如何修改?

  •   237 
  • 最後發表   neverdie62  2023 七月 03
neverdie62 發文於   2023/06/23

if barfreq<>"Min" or barinterval<>1 then raiseRunTimeError("請設定為1分K頻率");

inputs:J(2.5,"跳高幅度%"),OUT(60,"外盤比%");

if date<>date[1] and time<090500 then begin

condition1=openD(0)>closeD(1) and (openD(0)/closeD(1)-1)*100>J;//開盤跳高

{q_DailyOpen>q_RefPrice*(1+PriceXtime/100) and q_DailyOpen<q_RefPrice*(1+PriceLtime/100);//開盤跳空1.5%以上,但不可超過4%}

Condition2=q_OutSize/(q_InSize+q_OutSize)*100>OUT;//外盤比

condition3=getfield("volume","D")[1]>500;//昨量大於500張

condition4=q_EstimatedTotalVolume>500;//估計量大於500張

condition5=q_CurrentCapitalin100Million<30;//股本小於30億

Condition6=GetSymbolInfo("買賣現沖") or GetSymbolInfo("先買現沖");//可做多當沖股

end;

if condition1 and condition2 and condition3 and condition4 and condition5 and condition6 then begin

print(file("c:\XQStock\Data\開盤強勢股"), numtostr(date,0),","+symbol);

print(file("c:\XQStock\Data\開盤強勢股.csv"),symbol);

ret=1;

end;

排序方式: 標準 | 最新
XQ小幫手 發文於   2023/06/27

Hello neverdie62,

 

關於放入自選股報價的部分請參考 您好,請問如何讓自動執行的策略雷達選出的股票自動放入自選股報價中? 中的回覆。

 

if date<>date[1] and time<090500 then begin

這只有開盤第一根會符合。

若要開盤前5分鐘的話,只要使用 if time < 090500 then begin 即可。

 

if condition1 and condition2 and condition3 and condition4 and condition5 and condition6 then begin

這段最好也放在 if time < 090500 then begin 裡面,不然到了 090500 以後 condition1 ~ condition6 沒有運算的話就會維持在最後一次運算時的布林值。

neverdie62 發文於   2023/07/03

非常感謝解答!!!提醒的很好

發表回覆
Close