大家好:
今天要來講如何突破或跌破固定區間高低點時,則判斷進場或出場。
以下方圖示為例,取得前三根(固定區間)的高低點後,當後面的價位如果有突破或跌破時,則啟動觸發

程式碼範例如下:
input:Length(3,"區間"),firsttime(120000,"起始時間"),longshort(1,"進場/出場");; variable:highprice(0),lowprice(0),count(0); if date <> date[1] then count=0; if count < 3 and time >= firsttime then begin highprice = highest(high,Length); lowprice = lowest(low,Length); count = count+1; end; if close > highprice and longshort=1 then ret=1; if close < lowprice and longshort=2 then ret=1;
以上提供大家參考
2 評論