[求助]請老師幫忙編一個止損的語句
作者:金字塔 來源:cxh99.com 發(fā)布時間:2014年10月13日
- 咨詢內容:
我的想法是:如果持有多倉,當?shù)瞥謧}時的前n根k線的最低點是止損; 如果持有空倉,當漲過持倉時的前n根k線的最高點是止損;謝謝!
- 金字塔客服:
if holding>0 and l<ref(l,enterbars+n) then sell(1,0,market);
if holding<0 and h>ref(h,enterbars+n) then sellshort(1,0,marekt);