Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共3 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:请问日内交易,亏损达到1万就止损不再交易怎么写?

1楼
lhy5507 发表于:2014/11/24 16:03:20
请问日内交易,亏损达到1万就止损不再交易怎么写?
谢谢
2楼
qq代人发帖 发表于:2014/11/24 16:13:30

//多头为例

VARIABLE:a=0,n=0;
if date<>ref(date,1) then BEGIN
 a:=asset;
 n:=0;
 end
if 开仓条件 and n=0 then buy(holding=0,1,market);

if a-asset>=10000 then begin
sell(holding>0,holding,market);
n:=1;
end

[此贴子已经被作者于2014/11/24 16:14:09编辑过]
3楼
qwer123 发表于:2014/11/24 16:52:54
r1:=barslast(date<>ref(date,1));
if r1=0 then n1:=1;
if ref(asset,r1+1)-asset>10000 then
begin
sell(1,0,limitr,c);
sellshort(1,0,limitr,c);
n1:=-1;
end
//在开仓条件中加n1>0
共3 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.01611 s, 2 queries.