设为首页收藏本站

 找回密码
 注册
查看: 4480|回复: 2
打印 上一主题 下一主题

克罗三均线交易系统 [复制链接]

Rank: 1

精华
0
UID
182062
积分
5
帖子
4
主题
1
阅读权限
10
注册时间
2014-3-10
最后登录
2014-9-22
跳转到指定楼层
1#
发表于 2014-9-11 10:18:01 |只看该作者 |倒序浏览
runmode:0;
  input:n1(4,1,100,1);
  input:n2(9,1,100,1);
  input:n3(18,1,100,1);
  input:n4(100000,1,1000000,1);
  ma1:=ma(close,n1);
  ma2:=ma(close,n2);
  ma3:=ma(close,n3);
  if holding=0 then begin
  if close>ma1 and ma1>ma2 and ma2>ma3 then
  buy(1,1,limitr,close);
  end
  if holding=0 then begin
  if close<ma1 and ma1<ma2 and ma2<ma3 then
  buyshort(1,1,limitr,close);
  end
  if holding>0 then begin
  if ma1<ma2 then
  sell(1,holding,limitr,close);
  end
  if holding<0 then begin
  if ma1>ma2 then
  sellshort(1,holding,limitr,close);
  end

请教:1、如何改成TB系统?
2、每次开仓为帐户资金的30%如何加入?
3、进出场信号为K线的收盘价时的对手价以保证成交?或者以出现交易信号的K线要结束的最后3分钟以保证成交?该如何加入?
新手不懂,请老师们赐教,以便学习!谢谢!

Rank: 1

精华
0
UID
182062
积分
5
帖子
4
主题
1
阅读权限
10
注册时间
2014-3-10
最后登录
2014-9-22
2#
发表于 2014-9-12 10:30:57 |只看该作者
Params
        Numeric Length1(4);
        Numeric Length2(9);
        Numeric Length3(18);
        numeric lots(1);
Vars
        NumericSeries ma1;
        NumericSeries ma2;
        NumericSeries ma3;

Begin
        ma1 = AverageFC(Close,Length1);
        ma2 = AverageFC(Close,length2);
        ma3 = averagefc(close,length3);
        plotnumeric("ma1",ma1);
        plotnumeric("ma2",ma2);
        plotnumeric("ma3",ma3);

        If(close>Ma1[1] and ma1[1]> ma2[1] and ma2[1]> ma3[1])
        {
                Buy(lots,close);
        }
       
        If(close<Ma1[1]  and ma1[1]< ma2[1]and ma2[1]< ma3[1])
        {
                Sell(lots,close);
        }
        If(Ma1[1] < ma2[1])
        {
                SellShort(lots,close);
        }
        If( ma1[1]> ma2[1])
        {
                Buytocover(lots,close);
        }

使用道具 举报

Rank: 1

精华
0
UID
182062
积分
5
帖子
4
主题
1
阅读权限
10
注册时间
2014-3-10
最后登录
2014-9-22
3#
发表于 2014-9-12 10:32:30 |只看该作者
自己改完了,就是不知道对不对,还是不会加入30%仓位

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

bottom

静态版|手机版|联系我们|交易开拓者 ( 粤ICP备07044698   

GMT+8, 2024-5-23 18:10

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部