Script
”’#####################################################################################
”’#### Script Name: Market Watch ######
”’#### Author : Salah Abu-Ghalyon ######
”’#### Website : www.Hybridsolutions.com ######
”’#### Date : 20/06/2013 4:35:47 ######
”’#### Description:This code shows The Market watch on a created form ######
”’#####################################################################################
Sample
Dim _vSymbol as VTLGeneral.CSymbolDim lst as VTLGeneral.VTLControls.VTLListViewDim itemvalues as New System.Collections.Generic.List(Of VTLGeneral.VTLControls.ListViewItem)Public Sub main()Dim colvalue as VTLGeneral.VTLControls.ListViewcolumnDim itemvalue as VTLGeneral.VTLControls.ListViewItemDim colvalues as New System.Collections.Generic.List(Of VTLGeneral.VTLControls.ListViewcolumn)Dim frm as New VTLGeneral.VTLForm("frm1") Dim listOfcolumns as New VTLGeneral.VTLControls.ListViewcolumnsDim _index as integerlst= New VTLGeneral.VTLControls.VTLListView("lst1") frm.AddVTLControl(lst)frm.Height="7000 "frm.Width="8000"frm.show()lst.Height="15000"lst.Width="15000"lst.Top="1000"lst.left="500"lst.FontItalic=Truecolvalue= New VTLGeneral.VTLControls.ListViewcolumncolvalue.Text="Symbol Name"colvalue.Key="SymbolName"colvalue.Index=cstr(1)colvalues.Add(colvalue)colvalue= New VTLGeneral.VTLControls.ListViewcolumncolvalue.Text="Bid"colvalue.Key="Bid"colvalue.Index=cstr(2)colvalues.Add(colvalue)colvalue= New VTLGeneral.VTLControls.ListViewcolumncolvalue.Text="ASk"colvalue.Key="ASk"colvalue.Index=cstr(3)colvalues.Add(colvalue)colvalue= New VTLGeneral.VTLControls.ListViewcolumncolvalue.Text="High"colvalue.Key="High"colvalue.Index=cstr(4)colvalues.Add(colvalue)colvalue= New VTLGeneral.VTLControls.ListViewcolumncolvalue.Text="Low"colvalue.Key="Low"colvalue.Index=cstr(5)colvalues.Add(colvalue)lst.AddHeader(colvalues)colvalues.clear()Dim i As IntegerFor i = 1 To ClientCode.SymbolsCount_vSymbol = ClientCode.GetSymbolByIndex(i)If Not _vSymbol Is Nothing Then_index=_index+1itemvalue= New VTLGeneral.VTLControls.ListViewItemitemvalue.Text=_vSymbol.Nameitemvalue.Key="S" & _vSymbol.Nameitemvalue.Index=CSTR(_index)itemvalue.AddSubItem(_vSymbol.Bid)itemvalue.AddSubItem(_vSymbol.Ask)itemvalue.AddSubItem(_vSymbol.High)itemvalue.AddSubItem(_vSymbol.Low)itemvalues.Add(itemvalue)End IfNextlst.AddListItem(itemvalues)End SubPublic Sub OnTick()Dim i As IntegerFor i = 1 To ClientCode.SymbolsCount _vSymbol = ClientCode.GetSymbolByIndex(i)If Not _vSymbol Is Nothing Then SymbolChanged(_vSymbol)End IfNextEnd SubPublic Sub SymbolChanged(ByVal symbol As VTLGeneral.CSymbol)Dim listSubItemValues as New System.Collections.Generic.List(Of VTLGeneral.VTLControls.SubItem)Dim SubItemValue as VTLGeneral.VTLControls.SubItemSubItemValue= New VTLGeneral.VTLControls.SubItemSubItemValue.Index=1SubItemValue.Text=symbol.BidlistSubItemValues.Add(SubItemValue )SubItemValue= New VTLGeneral.VTLControls.SubItemSubItemValue.Index=2SubItemValue.Text=symbol.AsklistSubItemValues.Add(SubItemValue )lst.UpdateSubItem("S" & symbol.Name,listSubItemValues)End Sub
See Also