增减自选品种刷新问题 [金字塔]
- 咨询内容:
版主:我用两个按钮向自选板块中增加品种和减少品种,但必须按两次才能将品种增加到表中或从表中清除,不知什么原因,请帮忙解答谢谢!
Sub Look_CommandButton7_Click()
Set Grid = Technic.GetGridByName("Main")
Market=Grid.Market
Code=Grid.StockLabe
Set Table = Technic.GetGridByName("Main3").GetTable() '窗格Main3为表Call Table.SwitchBlock("监控",1) '“监控"切换动态牌自选分类下的自定义板块
Set block = CreateObject("stock.block")
block.Open "监控", 1
block.AddStock Market,Codeblock.tosave "自选","监控"
Table.Refurbish
End SubSub Look_CommandButton8_Click()
Set Grid = Technic.GetGridByName("Main")
Market=Grid.Market
Code=Grid.StockLabel
Set Table = Technic.GetGridByName("Main3").GetTable()
call Table.SwitchBlock("监控",1)
Set block = CreateObject("stock.block")
block.Open "监控", 1
For i = 0 To block.Count - 1
IF block.GetStockMarket(i)=Market AND block.GetStockCode(i)=Code THEN
block.removeat (i)
END IF
Next
block.tosave "自选","监控"
Table.Refurbish
End Sub - 金字塔客服:
Call Table.SwitchBlock("监控",1) 加到代码末行,再次切换到监控板块就可以了。
- 用户回复:
谢谢版主,问题解决!
- 网友回复:
版主:我需要将自选板块中的所有品种全部清除,但怎么都需要按几次按钮才能清除完毕,一次只能清除一部分,请教怎样才能全部清除?代码如下:
Sub Look_CommandButton8_Click()
Set Grid = Technic.GetGridByName("Main")
Market=Grid.Market
Code=Grid.StockLabel
Set Table = Technic.GetGridByName("Main3").GetTable()
call Table.SwitchBlock("监控",1)
Set block = CreateObject("stock.block")
block.Open "监控", 1
For i = 0 To block.Count - 1
block.removeat (i)
Next
block.tosave "自选","监控"call Table.SwitchBlock("监控",1)
End Sub - 网友回复:
For i = 0 To block.Count - 1
这一行倒过来写,从大到小,如:iCount=block.count-1
For i=icount to 0 step -1
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 1145508240 进行 有偿 编写!(不贵!点击查看价格!)
相关文章
-
没有相关内容