开拓者期货期权程序化系统交易论坛

标题: 老师看一下这一段是什么意思? [打印本页]

作者: CHENGFENGPOLANG    时间: 2019-1-7 12:34:12     标题: 老师看一下这一段是什么意思?

//        Commentary("amphigh="+text(amphigh));
//        Commentary("amplow="+text(amplow));
        PlotNumeric("jjx", dayavg);
        ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        if ((time[1]<0.20 and time>=0.21) or (((time[1]>0.13 and time[1]<=0.15) or time[1]<0.08 or time[1]>=0.2230) and time>=0.09 and time<0.10) or (time[1]<0.12 and time>=0.1330)) {
                barnum = 1;
                if (close>open) {upspeed = (high-low)/low*100; dnspeed =(high-close)/high*100;}
                else if (close<open){dnspeed = (high-low)/high*100; upspeed =(close-low)/low*100;}
                else {dnspeed = (high-low)/high*100; upspeed = (high-low)/low*100;}
                if ((time[1]>0.1400 and time[1]<=0.1500 and (time<=0.1000 or time>=0.2100))) {muspeed = upspeed; mdspeed = dnspeed;}
                usdis = 0; dsdis = 0; hipoint = 0; lopoint = 0; tnum = Mod(value(left(text(n), 4)),50)-2;         老师主要是这一行代码,是什么意思呢?
        } else {
                barnum = barnum[1] + 1;
        }
//        Commentary("barnum="+text(barnum));
作者: 小米    时间: 2019-1-7 14:00:31

这一行是对5个变量进行了赋值 ,其中前面四个变量都赋值 为0.
最后一个变量有一定的计算结算进行赋值,具体的可以看一下帮助文档里,mod,value,left,text等几个函数的用法。




欢迎光临 开拓者期货期权程序化系统交易论坛 (http://bbs.tb18.net/) Powered by Discuz! X2