以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp) -- 交易策略发布专区 (http://weistock.com/bbs/list.asp?boardid=10) ---- 可以调整的盈亏率止盈止损 模块 (http://weistock.com/bbs/dispbbs.asp?boardid=10&id=181837) |
-- 作者:ma-robot -- 发布时间:2020/8/23 10:29:29 -- 可以调整的盈亏率止盈止损 模块 {} INPUT:óˉ?ê0í£?y?a(0,0,99,1); INPUT:?÷?ê0í£?o?a(-0,-99,0,1); //ot:OPENPROFIT,NOAXIS; 2?±£?¤?e:ROUNDS( ("$HIGH##DAY" * MULTIPLIER * ( TACCOUNT(41)+TACCOUNT(42) )/2 ),0),NOAXIS,LINETHICK0; 2?óˉ?÷?ê:ROUNDS( 100*ROUNDS(OPENPROFIT/(2?±£?¤?e*ABS(HOLDING) ),4),1),NOAXIS,LINETHICK0,COLORGRAY; ?êóˉ?÷?ê:ROUNDS( 100*ROUNDS( (TACCOUNT(4))/(TACCOUNT(28) ),4),1),NOAXIS,LINETHICK0,COLORGRAY; ?ê?§μ???:TACCOUNT(53),,LINETHICK0; IF ?ê?§μ???=1 THEN óˉ?÷?ê:=?êóˉ?÷?ê,NOAXIS,LINETHICK0,COLORGRAY;{?ê?§μ???} ELSE óˉ?÷?ê:=2?óˉ?÷?ê,NOAXIS,LINETHICK0,COLORGRAY;{?ê?§í?3?} IF óˉ?÷?ê>óˉ?ê0í£?y?a AND óˉ?ê0í£?y?a<>0 THEN BEGIN SETTRADESIGN(1); ?à?1óˉ:SELL(1,0,NEXTOPEN); ???1óˉ:SELLSHORT(1,0,NEXTOPEN); END IF óˉ?÷?ê÷?ê0í£?o?a AND ?÷?ê0í£?o?a<>0 THEN BEGIN SETTRADESIGN(1); ?à?1?e:SELL(1,0,NEXTOPEN); ???1?e:SELLSHORT(1,0,NEXTOPEN); END {} |
-- 作者:ma-robot -- 发布时间:2020/8/23 10:45:13 -- {} INPUT:盈率0停正开(0,0,99,1); INPUT:亏率0停负开(-0,-99,0,1); 策保证金:ROUNDS( ("$HIGH##DAY" * MULTIPLIER * ( TACCOUNT(41)+TACCOUNT(42) )/2 ),0),NOAXIS,LINETHICK0; 策盈亏率:ROUNDS( 100*ROUNDS(OPENPROFIT/(策保证金*ABS(HOLDING) ),4),1),NOAXIS,LINETHICK0,COLORGRAY; 帐盈亏率:ROUNDS( 100*ROUNDS( (TACCOUNT(4))/(TACCOUNT(28) ),4),1),NOAXIS,LINETHICK0,COLORGRAY; 帐户登陆:TACCOUNT(53),,LINETHICK0; IF 帐户登陆=1 THEN 盈亏率:=帐盈亏率,NOAXIS,LINETHICK0,COLORGRAY;{帐户登陆} ELSE 盈亏率:=策盈亏率,NOAXIS,LINETHICK0,COLORGRAY;{帐户退出} IF 盈亏率>盈率0停正开 AND 盈率0停正开<>0 THEN BEGIN SETTRADESIGN(1); 多止盈:SELL(1,0,NEXTOPEN); 空止盈:SELLSHORT(1,0,NEXTOPEN); END IF 盈亏率<亏率0停负开 AND 亏率0停负开<>0 THEN BEGIN SETTRADESIGN(1); 多止损:SELL(1,0,NEXTOPEN); 空止损:SELLSHORT(1,0,NEXTOPEN); END {} [此贴子已经被作者于2020/8/23 10:47:12编辑过]
|
-- 作者:ma-robot -- 发布时间:2020/8/25 19:10:02 -- {新版本 } INPUT:盈率0停正开(15,0,99,1); INPUT:亏率0停负开(-5,-99,0,1); {} IF ABS(HOLDING)<>0 THEN BEGIN 保证金:=ROUNDS(("$HIGH##DAY" * MULTIPLIER * (TACCOUNT(41)+TACCOUNT(42))/2 ),0),NOAXIS,LINETHICK0; 盈亏率:=ROUNDS(100*ROUNDS(OPENPROFIT/(保证金*ABS(HOLDING)),4),1),NOAXIS,LINETHICK0,COLORGRAY; END {} IF 盈亏率>TOTALDAYTRADE AND 盈率0停正开<>0 THEN BEGIN 多盈:BUY(HOLDING=开仓手数,开仓手数,NEXTOPEN); 空盈:BUYSHORT(HOLDING=-开仓手数,开仓手数,NEXTOPEN); END {} IF 盈亏率>盈率0停正开 AND 盈率0停正开<>0 THEN BEGIN 多止盈:SELL(1,平仓手数,NEXTOPEN); 空止盈:SELLSHORT(1,平仓手数,NEXTOPEN); END {} IF 盈亏率<亏率0停负开 AND 亏率0停负开<>0 THEN BEGIN 多止损:SELL(1,平仓手数,NEXTOPEN); 空止损:SELLSHORT(1,0,NEXTOPEN); END {2020-825} |
-- 作者:无为剑 -- 发布时间:2020/8/25 23:04:06 -- 建议使用IE浏览器重新整理一下,其他浏览器可能导致格式异常 |
-- 作者:ma-robot -- 发布时间:2020/8/27 9:09:40 -- 以下是引用无为剑在2020/8/25 23:04:06的发言:
{}
INPUT:盈率0停正开(15,0,99,1);
INPUT:亏率0停负开(-5,-99,0,1);
{}
IF ABS(HOLDING)<>0 THEN BEGIN
保证金:=ROUNDS(("$HIGH##DAY" * MULTIPLIER * (TACCOUNT(41)+TACCOUNT(42))/2 ),0),NOAXIS,LINETHICK0;
盈亏率:=ROUNDS(100*ROUNDS(OPENPROFIT/(保证金*ABS(HOLDING)),4),1),NOAXIS,LINETHICK0,COLORGRAY;
END
{}
IF 盈亏率>TOTALDAYTRADE AND 盈率0停正开<>0 THEN BEGIN
多盈:BUY(HOLDING=开仓手数,开仓手数,NEXTOPEN);
空盈:BUYSHORT(HOLDING=-开仓手数,开仓手数,NEXTOPEN);
END
{}
IF 盈亏率>盈率0停正开 AND 盈率0停正开<>0 THEN BEGIN
多止盈:SELL(1,平仓手数,NEXTOPEN);
空止盈:SELLSHORT(1,平仓手数,NEXTOPEN);
END
{}
IF 盈亏率<-TOTALDAYTRADE AND 亏率0停负开<>0 THEN BEGIN
多损:BUY(HOLDING=开仓手数,开仓手数,NEXTOPEN);
空损:BUYSHORT(HOLDING=-开仓手数,开仓手数,NEXTOPEN);
END
{}
IF 盈亏率<亏率0停负开 AND 亏率0停负开<>0 THEN BEGIN
多止损:SELL(1,平仓手数,NEXTOPEN);
空止损:SELLSHORT(1,平仓手数,NEXTOPEN);
END
{测试一下 20200827}
建议使用IE浏览器重新整理一下,其他浏览器可能导致格式异常 [此贴子已经被作者于2020/8/27 9:11:29编辑过]
|
-- 作者:ma-robot -- 发布时间:2020/8/27 9:37:55 -- {} INPUT:盈率0停正开(15,0,99,1); INPUT:亏率0停负开(-5,-99,0,1); {} IF ABS(HOLDING)<>0 THEN BEGIN 保证金:=ROUNDS(("$HIGH##DAY" * MULTIPLIER * (TACCOUNT(41)+TACCOUNT(42))/2 ),0),NOAXIS,LINETHICK0;
盈亏率:=ROUNDS(100*ROUNDS(OPENPROFIT/(保证金*ABS(HOLDING)),4),1),NOAXIS,LINETHICK0,COLORGRAY; END {}{ IF 盈亏率>TOTALDAYTRADE AND 盈率0停正开<>0 THEN BEGIN
多盈:BUY(HOLDING=开仓手数,开仓手数,NEXTOPEN);
空盈:BUYSHORT(HOLDING=-开仓手数,开仓手数,NEXTOPEN); END {} IF 盈亏率>盈率0停正开 AND 盈率0停正开<>0 THEN BEGIN
多止盈:SELL(1,平仓手数,NEXTOPEN);
空止盈:SELLSHORT(1,平仓手数,NEXTOPEN); END {}{ IF 盈亏率<-TOTALDAYTRADE AND 亏率0停负开<>0 THEN BEGIN
多损:BUY(HOLDING=开仓手数,开仓手数,NEXTOPEN);
空损:BUYSHORT(HOLDING=-开仓手数,开仓手数,NEXTOPEN); END {} IF 盈亏率<亏率0停负开 AND 亏率0停负开<>0 THEN BEGIN
多止损:SELL(1,平仓手数,NEXTOPEN);
空止损:SELLSHORT(1,平仓手数,NEXTOPEN); END {切换IE测试} ok了。。。 [此贴子已经被作者于2020/8/27 9:38:38编辑过]
|