請(qǐng)問日內(nèi)交易,虧損達(dá)到1萬就止損不再交易怎么寫?
作者:金字塔 來源:cxh99.com 發(fā)布時(shí)間:2015年10月20日
- 咨詢內(nèi)容:
請(qǐng)問日內(nèi)交易,虧損達(dá)到1萬就止損不再交易怎么寫?謝謝
- 金字塔客服:
//多頭為例
VARIABLE:a=0,n=0;
if date<>ref(date,1) then BEGIN
a:=asset;
n:=0;
end
if 開倉(cāng)條件 and n=0 then buy(holding=0,1,market);
if a-asset>=10000 then begin
sell(holding>0,holding,market);
n:=1;
end
[此貼子已經(jīng)被作者于2014/11/24 16:14:09編輯過]
- 用戶回復(fù):
r1:=barslast(date<>ref(date,1));if r1=0 then n1:=1;
if ref(asset,r1+1)-asset>10000 thenbeginsell(1,0,limitr,c);sellshort(1,0,limitr,c);n1:=-1;end//在開倉(cāng)條件中加n1>0