您现在的位置是:主页 > news > 铜陵网站建设推广/班级优化大师免费下载学生版
铜陵网站建设推广/班级优化大师免费下载学生版
admin2025/6/7 20:13:47【news】
简介铜陵网站建设推广,班级优化大师免费下载学生版,国外免费空间建网站,真么在网站里搜索i问财数据获取示例,抛砖引玉。http://www.iwencai.com/添加条件:主动买入比>主动卖出比且主动买入比排名前100 (100个)查询结果如下:ahk来搞定/* 功能: 1、爬取i问财主动买入比前1002、 作者:sunwind1576157 日…
铜陵网站建设推广,班级优化大师免费下载学生版,国外免费空间建网站,真么在网站里搜索i问财数据获取示例,抛砖引玉。http://www.iwencai.com/添加条件:主动买入比>主动卖出比且主动买入比排名前100 (100个)查询结果如下:ahk来搞定/*
功能: 1、爬取i问财主动买入比前1002、
作者:sunwind1576157
日…

i问财数据获取示例,抛砖引玉。
http://www.iwencai.com/
添加条件:
主动买入比>主动卖出比且主动买入比排名前100 (100个)
查询结果如下:

ahk来搞定

/*
功能: 1、爬取i问财主动买入比前1002、
作者:sunwind1576157
日期:2021/11/7
*/
#SingleInstance,force
Gui, Add, Edit,R1 vMyEdit0 W480,主动买入比>主动卖出比从大到小排名前100
Gui, Add, Button, ys Default w80,确定
Gui, Add, Tab3,xs section , 主动买入比前100|同花顺人气100
Gui, Tab, 1
Gui, Add, Edit, R24 vMyEdit2 w550
Gui, Add, StatusBar,, 作者:sunwind1576157.
Gui, Show, x55 y66 w600 h440, 简单炒股 快乐生活
return
Button确定:
Gui,Submit,NoHide
主动买入比前100:=select_stock(MyEdit0)
GuiControl,, MyEdit2, %主动买入比前100%
return
select_stock(xg_tj="主动买入比>主动卖出比从大到小排名前100",hold_num:=200)
{if (A_WDay=1)dif:=-2else if (A_WDay=7)dif:=-1else if (A_WDay=2)dif:=-3elsedif:=-1endDate=%A_YYYY%%A_MM%%A_DD%endDate += dif, daysStringLeft,endDate,endDate,8SB_SetText("查询: " . xg_tj . " 中...")
urlxg :="http://backtest.10jqka.com.cn/tradebacktest/historypick?query=" . xg_tj . "&hold_num=" . hold_num . "&trade_date=" . endDate headers:=""
xg:=URLDownloadToVar(urlxg,headers)objxg:=JSON_ToObj(xg)RowCount:=objxg.result.stocks.MaxIndex()
If (RowCount="")RowCount:=0
SB_SetText("查询出: " . RowCount . " 个结果")
ret:=""
loop, %RowCount%
{this_row:=A_index . "`t" . objxg.result.stocks[A_index].stock_code . "`t" . objxg.result.stocks[A_index].stock_nameret.=this_row . "`n"
}
return ret
}
;======================辅助函数=================================
; Copyright 漏 2013 VxE. All rights reserved.
; Uses a two-pass iterative approach to deserialize a json string
json_toobj( str ) {quot := """" ; firmcoded specifically for readability. Hardcode for (minor) performance gain, ws := "`t`n`r " Chr(160) ; whitespace plus NBSP. This gets trimmed from the markup, obj := {} ; dummy object, objs := [] ; stack, keys := [] ; stack, isarrays := [] ; stack, literals := [] ; queue, y := nest := 0; First pass swaps out literal strings so we can parse the markup easilyStringGetPos, z, str, %quot% ; initial seekwhile !ErrorLevel{; Look for the non-literal quote that ends this string. Encode literal backslashes as '\u005C' because the; '\u..' entities are decoded last and that prevents literal backslashes from borking normal charactersStringGetPos, x, str, %quot%,, % z + 1while !ErrorLevel{StringMid, key, str, z + 2, x - z - 1StringReplace, key, key, \\, \u005C, AIf SubStr( key, 0 ) != "\"BreakStringGetPos, x, str, %quot%,, % x + 1}; StringReplace, str, str, %quot%%t%%quot%, %quot% ; this might corrupt the stringstr := ( z ? SubStr( str, 1, z ) : "" ) quot SubStr( str, x + 2 ) ; this won't; Decode entitiesStringReplace, key, key, \%quot%, %quot%, AStringReplace, key, key, \b, % Chr(08), AStringReplace, key, key, \t, % A_Tab, AStringReplace, key, key, \n, `n, AStringReplace, key, key, \f, % Chr(12), AStringReplace, key, key, \r, `r, AStringReplace, key, key, \/, /, Awhile y := InStr( key, "\u", 0, y + 1 )if ( A_IsUnicode || Abs( "0x" SubStr( key, y + 2, 4 ) ) < 0x100 )key := ( y = 1 ? "" : SubStr( key, 1, y - 1 ) ) Chr( "0x" SubStr( key, y + 2, 4 ) ) SubStr( key, y + 6 )literals.insert(key)StringGetPos, z, str, %quot%,, % z + 1 ; seek}; Second pass parses the markup and builds the object iteratively, swapping placeholders as they are encounteredkey := isarray := 1; The outer loop splits the blob into paths at markers where nest level decreasesLoop Parse, str, % "]}"{StringReplace, str, A_LoopField, [, [], A ; mark any array open-brackets; This inner loop splits the path into segments at markers that signal nest level increasesLoop Parse, str, % "[{"{; The first segment might contain members that belong to the previous object; Otherwise, push the previous object and key to their stacks and start a new objectif ( A_Index != 1 ){objs.insert( obj )isarrays.insert( isarray )keys.insert( key )obj := {}isarray := key := Asc( A_LoopField ) = 93}; arrrrays are made by pirates and they have index keysif ( isarray ){Loop Parse, A_LoopField, `,, % ws "]"if ( A_LoopField != "" )obj[key++] := A_LoopField = quot ? literals.remove(1) : A_LoopField}; otherwise, parse the segment as key/value pairselse{Loop Parse, A_LoopField, `,Loop Parse, A_LoopField, :, % wsif ( A_Index = 1 )key := A_LoopField = quot ? literals.remove(1) : A_LoopFieldelse if ( A_Index = 2 && A_LoopField != "" )obj[key] := A_LoopField = quot ? literals.remove(1) : A_LoopField}nest += A_Index > 1} ; Loop Parse, str, % "[{"If !--nestBreak; Insert the newly closed object into the one on top of the stack, then pop the stackpbj := objobj := objs.remove()obj[key := keys.remove()] := pbjIf ( isarray := isarrays.remove() )key++} ; Loop Parse, str, % "]}"Return obj
} ; json_toobj( str )
URLDownloadToVar(url, headers="", Encoding = "utf-8",Method="GET",postData=""){ ;网址,编码,请求方式,post数据hObject:=ComObjCreate("WinHttp.WinHttpRequest.5.1")try{hObject.SetTimeouts(30000,30000,1200000,1200000)hObject.Open(Method,url,(Method="POST" ? True : False))hObject.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")if IsObject(headers){for k,v in headershObject.SetRequestHeader(k, v)}hObject.Send(postData)if (Method="POST")hObject.WaitForResponse(-1)}catch ereturn -1if (Encoding && hObject.ResponseBody){oADO := ComObjCreate("adodb.stream")oADO.Type := 1oADO.Mode := 3oADO.Open()oADO.Write(hObject.ResponseBody)oADO.Position := 0oADO.Type := 2oADO.Charset := Encodingreturn oADO.ReadText(), oADO.Close()}return hObject.ResponseText
}