设为首页收藏本站

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

小周期计算加权均价,昨收今开价格 [复制链接]

Rank: 4

精华
0
UID
219061
积分
287
帖子
18
主题
8
阅读权限
50
注册时间
2015-9-7
最后登录
2021-3-19
跳转到指定楼层
1#
发表于 2017-10-9 16:44:09 |只看该作者 |倒序浏览
Params
               
       
       
Vars
       
        NumericSeries                 baramount(0);
        NumericSeries                 barvol(0);
        numericseries                 Tdayavg(0);
        NumericSeries                TdayOpen(0);
        NumericSeries                YdayClose(0);
       
       
       
       
Begin
       
        If(!CallAuctionFilter()) Return;       
       
        If(BarStatus == 0)
        {
                       
        }
       
        //**********************************
        if(date!=Date[1])
        {
                        baramount=close*Vol;
                        barvol=vol;
                        TdayOpen = open;
                        YDayClose = close[1];
        }else
        {
                        baramount = baramount[1]+close*vol;
                        barvol = barvol[1]+vol;
        }
    Tdayavg = baramount / barvol;
        Plotnumeric("dayavg",Tdayavg);
        PlotNumeric("TdayOpen",TdayOpen);
        Plotnumeric("YdayClose",YdayClose);
        //*****************************
       
       
End

这个公式计算出来的值,是以早上九点开盘到晚上收盘为计算区间的,对有夜盘的品种,这个值是有问题的

请问版主该如果改进
您需要登录后才可以回帖 登录 | 注册

bottom

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

GMT+8, 2024-4-23 18:09

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部