下面是一段代码:
Function formula1_updatepos(Formula)
'系统会在逐K线模式解释公式时的每个周期都会调用此函数一遍,因此设计时应该注重程序的执行效率,不要重复的执行一些没必要的代码
formula1_updatepos=0
Dim mytext, nPosOld, nPosNew, idx
idx = Formula.DataSize - 2
if idx > 0 then
mydatetime1 = "" & document.GetExtString("Formula1_datetime")
mydatetime2 = "" & Formula.GetBufDateData(idx)
if UCase(mydatetime1) = UCase(mydatetime2) then
else
document.SetExtString "Formula1_datetime", "" & mydatetime2
application.WinExec "cmd /c break > c:\formula1_pos.txt", 0
call Application.SetTimer(1, 1000)
end if
end if
End Function
但是显示仓位和策略信号不一样的,我策略上是空单 但输出来是0 应该输出-1才对