你好,我是做現貨當沖+短線交易
想請小編幫忙寫一個出場策略
1. 當天13:10分時,股價非漲停,且賺超過2%,則賣出
2. 當天漲停,則判斷隔天9:05分是否漲停,非漲停則賣出,或漲停被打開且跌低於漲停2%也賣出,若漲停至收盤,則延續到隔天再判斷一次
3. 兩者都不是,則之後只要股價大於成本即賣出
你好,我是做現貨當沖+短線交易
想請小編幫忙寫一個出場策略
1. 當天13:10分時,股價非漲停,且賺超過2%,則賣出
2. 當天漲停,則判斷隔天9:05分是否漲停,非漲停則賣出,或漲停被打開且跌低於漲停2%也賣出,若漲停至收盤,則延續到隔天再判斷一次
3. 兩者都不是,則之後只要股價大於成本即賣出
Hello 小李飛刀,
網站上有教學區,裡面有XS語法的基礎和應用可以閱覽。
小幫手並沒有提供代寫服務。
您可以用 漲停價 欄位取得當日的漲停價,交易腳本可以使用 filledavgprice 取得進場成本計算獲利百分比。
可以用交易函數來取得交易相關的資訊 (ex.進場日期時間)。
簡單舉例,1分鐘頻率作多的狀況下:
condition1 = filled > 0 and time = 131000 and close < getfield("漲停價","D") and close > filledavgprice * 1.02;
condition2 = filled > 0 and FilledRecordDate(FilledRecordCount) < date and time = 090500 and close <> getfield("漲停價","D");
condition3 = filled > 0 and FilledRecordDate(FilledRecordCount) < getfield("Date", "D")[2] and not condition1 and not condition2 and close > filledavgprice;
if condition1 or condition2 or condition3 then setposition(0, market);
1 評論