2 Star 4 Fork 10

王布衣/engine

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
margintrading.go 1.78 KB
一键复制 编辑 原始数据 按行查看 历史
package tdxweb
import (
"fmt"
"gitee.com/quant1x/gox/http"
)
const (
// https://wenda.tdx.com.cn/site/wenda/stock_index.html?message=%E8%9E%8D%E8%B5%84%E8%9E%8D%E5%88%B8
//urlMarginTrading = "https://wenda.tdx.com.cn/TQL?Entry=JNLPSE.getAllCode&RI=6C07"
urlMarginTrading = "https://wenda.tdx.com.cn/TQL?Entry=JNLPSE.getAllCode&RI=6BFD"
)
func MarginTrading() {
//params := urlpkg.Values{
// "direction": {direction.String()},
// "code": {fmt.Sprintf("%s.%s", symbol, strings.ToUpper(mflag))},
// "price": {fmt.Sprintf("%f", price)},
// "volume": {fmt.Sprintf("%d", volume)},
// "strategy": {models.QmtStrategyName(model)},
// "remark": {models.QmtOrderRemark(model)},
//}
//body := params.Encode()
body := `[{"nlpse_id":"7318110250698020161","op_flag":1,"sec_code":"","order_field":"sec_code","dynamic_order":"","order_flag":"1","POS":"0","COUNT":"30","timestamps":0,"RANG":"AG"}]`
//body = `[{"op_flag":1,"sec_code":"","order_field":"sec_code","dynamic_order":"","order_flag":"1","POS":"0","COUNT":"30","timestamps":0,"RANG":"AG"}]`
body = `[{"nlpseId":"7318094960614448284","orderField":"chg","orderFlag":"0"}]`
//logger.Infof("trader-order: %s", body)
header := map[string]any{
http.ContextType: "application/x-www-form-urlencoded" + "; charset=UTF-8",
//"Cookie": "Hm_lvt_5c4c948b141e4d66943a8430c3d600d0=1703193725; Hm_lpvt_5c4c948b141e4d66943a8430c3d600d0=1703720553; LST=10; ASPSessionID=3755195075085152819",
"Cookie": "Hm_lvt_5c4c948b141e4d66943a8430c3d600d0=1703193725; Hm_lpvt_5c4c948b141e4d66943a8430c3d600d0=1703720553; LST=10; ASPSessionID=3755195113739858633",
"Origin": "https://wenda.tdx.com.cn",
"Referer": "https://wenda.tdx.com.cn/",
}
data, _, err := http.Request(urlMarginTrading, http.MethodPost, body, header)
fmt.Println(data, err)
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/quant1x/engine.git
git@gitee.com:quant1x/engine.git
quant1x
engine
engine
v1.5.2

搜索帮助

Cb406eda 1850385 E526c682 1850385