Board logo

标题: 【vwapResettable】 [打印本页]

作者: 龙听    时间: 2022-11-2 14:20     标题: 【vwapResettable】

  1. input:
  2.    PriceValue(NumericSeries),
  3.    LocalHrsOffset(NumericSimple),
  4.    time1(NumericSimple),
  5.    time2(NumericSimple),
  6.    time3(NumericSimple),
  7.    time4(NumericSimple),
  8.    time5(NumericSimple);

  9. vars:
  10.    var0(0),
  11.    var1(0),
  12.    var2(0),
  13.    var3(0);

  14. var3 = MinutesToTime(TimeToMinutes(time)+LocalHrsOffset*60);

  15. if    date<>date[1]
  16.    or var3=time1
  17.    or var3=time2
  18.    or var3=time3
  19.    or var3=time4
  20.    or var3=time5 then begin
  21.       var0 = 0;
  22.       var1 = 0;      
  23. end;

  24. var0 = var0 + (PriceValue * Ticks);
  25. var1 = var1 + Ticks;

  26. if var1 > 0 then
  27.    var2 = var0 / var1
  28. else
  29.    var2 = PriceValue;

  30. VWAPResettable = var2;
复制代码





欢迎光临 龙听期货论坛 (http://www.qhlt.cn/) Powered by Discuz! 7.2