請教平倉代碼的問題 [金字塔]
- 咨詢內容:
variable:maxprofit=0;
variable:win=0;
variable:win2=0;IF holding>0 and enterbars>0 THEN BEGIN
win:=high-enterprice;
IF win>maxprofit THEN maxprofit:=win;
win2:=maxprofit-win;
END
盈利大于50,小于100時,回撤30%平多 win2>=0.3*maxprofit then sell();盈利大于50,小于100,這個條件描述是用 maxprofit>50 and maxprofit<100,還是 win>50 AND win<100 呢?
我之前用的maxprofit,但空頭(enterprice-L)止盈結果不對,用win反而對了,但是多頭止盈又不正常了。
- 金字塔客服:
maxprofit_duo:=hhv(h-enterprice,enterbars+1);
maxprofit_kong:=llv(enterprice-l,enterbars+1);
if maxprofit_duo>100 and maxprofit_duo<50 and holding>0 and c-enterpcie<=0.3*maxprofit_duo then sell;
if maxprofit_kong>100 and maxprofit_kong<50 and holding<0 and enterpcie-c<=0.3*maxprofit_kong then sell;
- 用戶回復:
以下是引用jinzhe在2013/12/6 9:41:27的發言:
maxprofit_duo:=hhv(h-enterprice,enterbars+1);
maxprofit_kong:=llv(enterprice-l,enterbars+1);
if maxprofit_duo>100 and maxprofit_duo<50 and holding>0 and c-enterpcie<=0.3*maxprofit_duo then sell;
if maxprofit_kong>100 and maxprofit_kong<50 and holding<0 and enterpcie-c<=0.3*maxprofit_kong then sell;
c-enterpcie<=0.3*maxprofit_duo then sell
回撤超過30%,應該是 c-enterpcie <= (1-0.3)*maxprofit_duo 吧?
- 網友回復:
這個數學上的定義,用戶自己斟酌吧,我主要給出思路
- 網友回復:
以下是引用jinzhe在2013/12/6 13:05:32的發言:
if maxprofit_kong>100 and maxprofit_kong<50 and holding<0 and enterpcie-c<=0.3*maxprofit_kong then sell;
多頭沒問題,空頭仍然不對,不出信號,空頭如果去掉“maxprofit_kong>100 and maxprofit_kong<50” 這個條件就正常了
這也太怪了吧,為啥呢
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 1145508240 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容