在通达信软件里设置将预警输出到文件,可以用AutoHotkey定时监测,并解析预警相关信息。
#Persistent
#SingleInstance,Force
OnExit, StopWatching
WatchFile=F:ahk炒股预警.txt
SetTimer, Watch, 1000
Return
Watch:
FileGetTime,newTime,%WatchFile%
if (newTime>oldTime)
{
oldTime:=newTime
OutputDebug,%oldTime%-- %newTime%
Loop, read, %WatchFile%
last_line := A_LoopReadLine
MsgBox, 4, ,最新的预警信息:%last_line%, 3
}
return
StopWatching:
SetTimer,Watch,off
ExitApp