设为首页收藏本站

 找回密码
 注册
楼主: kgy000
打印 上一主题 下一主题

请求帮助: [复制链接]

Rank: 4

精华
0
UID
5563
积分
382
帖子
25
主题
5
阅读权限
50
注册时间
2009-9-29
最后登录
2015-4-1
21#
发表于 2009-12-31 09:34:56 |只看该作者

回复 3# lh948 的帖子

If(CrossOver(lon,0))
                {
                        Buy(1,0);
                }Else If(CrossUnder(lon,0))
                {
                        SellShort(1,0);
                }
   请问版主,如果要反手延迟5秒怎么写。谢谢!

使用道具 举报

Rank: 10Rank: 10Rank: 10

精华
2
UID
4130
积分
20901
帖子
6519
主题
17
阅读权限
200
注册时间
2009-4-15
最后登录
2019-4-12
22#
发表于 2009-12-31 10:06:28 |只看该作者
已解决

Vars
        NumericSeries diff;
        NumericSeries dea;
        NumericSeries lon;
        Numeric vid;
        NumericSeries rc;
        NumericSeries mlong;
Begin
        
        
        If(BarStatus==0)
                mlong=0;
        Else If(CurrentBar>=2)
        {
                If(high==Low)
                                        vid=0;
                                Else
                                        vid=Summation(Vol,2)/((Highest(HIGH,2)-Lowest(LOW,2))*100);
                rc=(Close-Close[2])*vid;
                //mlong=rc+mlong[1];
        
                mlong=Summation(rc,CurrentBar+1);
                diff=SMA(mlong,15,1);
                dea=SMA(mlong,20,1);
                lon=diff-dea;
                If(CrossOver(lon,0))
                {
                        Buy(1,0);
                }Else If(CrossUnder(lon,0))
                {
                        SellShort(1,0);
                }
        }
Commentary("vid="+Text(vid));
Commentary("CurrentBar="+Text(CurrentBar));
Commentary("mlong="+Text(mlong));
Commentary("rc="+Text(rc));
End

配合以下指标,可以查看lon
Params
        
Vars
        NumericSeries diff;
        NumericSeries dea;
        NumericSeries lon;
        Numeric vid;
        NumericSeries rc;
        NumericSeries mlong;
Begin
        If(BarStatus==0)
                mlong=0;
        Else If(CurrentBar>=2)
        {
                If(high==Low)
                                        vid=0;
                Else
                        vid=Summation(Vol,2)/((Highest(HIGH,2)-Lowest(LOW,2))*100);
                rc=(Close-Close[2])*vid;
                mlong=Summation(rc,CurrentBar+1);
                diff=SMA(mlong,15,1);
                dea=SMA(mlong,20,1);
                lon=diff-dea;
        }
        PlotNumeric("line",0);
        PlotNumeric("lon",lon);
End

使用道具 举报

Rank: 10Rank: 10Rank: 10

精华
2
UID
4130
积分
20901
帖子
6519
主题
17
阅读权限
200
注册时间
2009-4-15
最后登录
2019-4-12
23#
发表于 2009-12-31 10:09:58 |只看该作者
原因是因为有两个bar的最高和最低相等,导致出错
tb和通达信不同,k线小结时间不同等等一些因素,会导致在信号上会有点差异,毕竟是两个软件

使用道具 举报

Rank: 3Rank: 3

精华
0
UID
4528
积分
168
帖子
47
主题
7
阅读权限
40
注册时间
2009-5-30
最后登录
2010-1-15
24#
发表于 2010-1-3 15:14:27 |只看该作者
多谢老师!!!!!!!!!!!!

使用道具 举报

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

bottom

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

GMT+8, 2024-5-4 13:04

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部