因為小弟對於程式語言是0基礎 都是上網自學,所以想請小幫手或高手們幫看一下小弟寫的腳本有無問題
或有更好的 簡易的寫法 告訴小弟
我寫了一個盤中策略是
1.即時股價乖離即時5日線正負2%以內
2.即時5日均 60均都是上揚
3.即時5日均大於即時60日均
4.即時成交量大餘1000張
5.顯示的個股 可當沖 and 有權證
麻煩幫我看一下腳本 謝謝
value1 = average(getfield("Close", "D"), 5);
//5日均線
value2 = AbsValue(100 * (close - value1) / value1);
//5日均線乖離率
condition1= Volume>1000;
//成交量>1000張
condition2= average(getfield("Close", "D"), 5) > average(getfield("Close", "D")[1], 5);
//即時5日均>昨日收盤5日均
condition3= average(getfield("Close", "D"), 60) > average(getfield("Close", "D")[1], 60);
//即時60日均>昨日收盤60日均
condition4= average(getfield("Close", "D"), 5) > average(getfield("Close", "D"), 60);
//即時5日均>即時60日均
condition5= value2 <= 2;
//即時5日股價乖離均線2%以內
condition6=GetSymbolInfo("WithCallWarrant");
//"有無認購權證",支援台股,僅提供最新資料,回傳布林值。
condition7=GetSymbolInfo("IsDayTrading");
//"買賣現沖",支援台股,回傳布林值。只有在執行回測的時候有歷史資
if condition1 and condition2 and condition3 and condition4 and condition5 and condition6 and condition7 then
ret=1;
3 評論