- UID
- 2
- 积分
- 2874604
- 威望
- 1387331 布
- 龙e币
- 1487273 刀
- 在线时间
- 13155 小时
- 注册时间
- 2009-12-3
- 最后登录
- 2024-11-24
|
【StepTPO_N】
- inputs:
- ResNum(NumericSimple),
- SessNum(NumericSimple),
- _Date(NumericSimple),
- _Time(NumericSimple),
- StepMin(NumericSimple),
- ModeStep(NumericSimple),
- TPOStep(NumericRef);
- //StepTPO(StartTime,CurTime,StepMin,ModeStep,TPOStep);
- Variables: intrabarpersist NumStep(0),
- intrabarpersist SavNumStep(0),
- intrabarpersist Res(false);
- var: dw(0), ct(0), st(0), steps_from_start(0);
- dw = dayofweek(_Date);
- ct = TimeToMinutes(_Time);
- st = sessionstarttime(0, SessNum);
- st = TimeToMinutes(st);
- if CurrSess(ResNum, SessNum) then begin
- if sessionstartday(0, SessNum) = sessionendday(0, SessNum) then begin
- NumStep = IntPortion((ct - st)/StepMin)+1;
- end else begin
- if dw = sessionendday(0, SessNum) then begin
- NumStep = IntPortion((ct+1440 - st)/StepMin)+1;
- end;
- end;
-
- end;
- Res = false;
- if NumStep <> SavNumStep then begin
- if ModeStep=0 then begin
- TPOStep = TPOStep+1;
- end else begin
- TPOStep = NumStep;
- end;
- Res = true;
- SavNumStep = NumStep;
- end;
- StepTPO_N = Res;
复制代码 |
论坛官方微信、群(期货热点、量化探讨、开户与绑定实盘)
|