Rss & SiteMap

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

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

标题:求截止上次平仓,已经连亏多少期

1楼
6_6 发表于:2016/2/25 13:30:49
求截止上次平仓,已经连亏多少次

不管当前有没有开仓,都显示截止上次平仓的时候,连亏多少次,不是历史最大连亏

谢谢老师


2楼
6_6 发表于:2016/2/25 13:32:30
如果遇到当日是平仓日,则显示当前连亏多少次
3楼
jinzhe 发表于:2016/2/25 13:46:32

这个要写一个具体的框架的,用户带进自己的条件即可

 

variable:n=0;

 

if 平多条件 and holding>0 then begin

    sell(1,0,marketr);

    if numprofit(1)>0 then n:=0;

    if numprofit(1)<0 then n:=n+1;

end

 

if 平空条件 and holding<0 then begin

    sellshort(1,0,marketr);

    if numprofit(1)>0 then n:=0;

    if numprofit(1)<0 then n:=n+1;

end

 

n为当前连亏次数

4楼
6_6 发表于:2016/2/25 15:01:34
太牛了,谢谢jinzhe老师!

如果定义盈利不够3%则为亏损,这样计算连亏,应该怎么写,谢谢!


5楼
6_6 发表于:2016/2/25 15:04:50
利:=(exitprice/enterprice-1)*100,nodraw;

    if 平多条件 and 利<3 then begin
        k:=k+1;
        y:=0;
    end
end

k为连亏,对吗?
6楼
6_6 发表于:2016/2/25 15:08:18
利:=(exitprice/enterprice-1)*100,nodraw;

好像我写的不对噢
7楼
jinzhe 发表于:2016/2/25 15:09:18

variable:n=0;

 

if 平多条件 and holding>0 then begin

    sell(1,0,marketr);

    nn:=(exitpricie-enterprice)/enterprice;

    if nn>=0.03 then n:=0;

    if nn<0.03 then n:=n+1;

end

 

if 平空条件 and holding<0 then begin

    nn:=(enterprice-exitprice)/exitprice;

    sellshort(1,0,marketr);

    if nn>=0.03 then n:=0;

    if nn<0.03 then n:=n+1;

end

8楼
6_6 发表于:2016/2/25 15:11:59
lili:=if(平多条件=1,c,exitprice);
利:(lili/enterprice-1)*100,nodraw;
9楼
6_6 发表于:2016/2/25 15:12:38
谢谢,还是您的对,棒棒哒
10楼
jinzhe 发表于:2016/2/25 15:13:49

你这样写不能写在平仓语句前, 获取的值不是当次平仓的值了

共10 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.04688 s, 3 queries.