0
Private Sub dow30_1min()
        command("Dow 30", "http://www.investing.com/indices/us-30-futures-technical?period=60", "1 minutes")
    End Sub

    Public Sub command(ByRef name As String, ByRef webadd As String, ByRef time As String)
        WebBrowser1.Navigate(webadd)
        Dim a As String
        Dim b As String
        Dim c As String
        Dim d As String
        Dim f As String
        Dim newItem As ListViewItem
        a = InStr(TextBox1.Text, stb.Text)
        b = InStr(TextBox1.Text, by.Text)
        c = InStr(TextBox1.Text, sl.Text)
        d = InStr(TextBox1.Text, sts.Text)
        f = InStr(TextBox1.Text, nl.Text)
        If a Then
            newItem = ListView2.Items.Add(Format(Now, "Short Time") & " " & Format(Now, "Short Date")) 'col no. 1  
            With newItem
                .UseItemStyleForSubItems = False
                .SubItems.Add(Trim(name)) 'col no. 2 
                .SubItems.Add(Trim("STRONG BUY")) 'col no. 4  
                .SubItems.Add(Trim(time))
                .SubItems(2).BackColor = Color.Green
                .SubItems(2).ForeColor = Color.White
            End With

        ElseIf b Then
            newItem = ListView2.Items.Add(Format(Now, "Short Time") & " " & Format(Now, "Short Date")) 'col no. 1  
            With newItem
                .UseItemStyleForSubItems = False
                .SubItems.Add(Trim(name)) 'col no. 2 
                .SubItems.Add(Trim("BUY")) 'col no. 4  
                .SubItems.Add(Trim(time))
                .SubItems(2).BackColor = Color.Green
                .SubItems(2).ForeColor = Color.White
            End With

        ElseIf c Then
            newItem = ListView2.Items.Add(Format(Now, "Short Time") & " " & Format(Now, "Short Date")) 'col no. 1  
            With newItem
                .UseItemStyleForSubItems = False
                .SubItems.Add(Trim(name)) 'col no. 2 
                .SubItems.Add(Trim("SELL")) 'col no. 4  
                .SubItems.Add(Trim(time))
                .SubItems(2).BackColor = Color.Red
                .SubItems(2).ForeColor = Color.White
            End With

        ElseIf d Then
            newItem = ListView2.Items.Add(Format(Now, "Short Time") & " " & Format(Now, "Short Date")) 'col no. 1  
            With newItem
                .UseItemStyleForSubItems = False
                .SubItems.Add(Trim(name)) 'col no. 2 
                .SubItems.Add(Trim("STRONG SELL")) 'col no. 4  
                .SubItems.Add(Trim(time))
                .SubItems(2).BackColor = Color.Red
                .SubItems(2).ForeColor = Color.White
            End With

        ElseIf f Then
            newItem = ListView2.Items.Add(Format(Now, "Short Time") & " " & Format(Now, "Short Date")) 'col no. 1  
            With newItem
                .UseItemStyleForSubItems = False
                .SubItems.Add(Trim(name)) 'col no. 2 
                .SubItems.Add(Trim("NEUTRAL")) 'col no. 4 
                .SubItems.Add(Trim(time))
                .SubItems(2).BackColor = Color.Gray
                .SubItems(2).ForeColor = Color.White
            End With
        End If

        Dim myWriter As New IO.StreamWriter(Application.CommonAppDataPath & "\" & name & ".txt")
        For Each myItem As ListViewItem In ListView2.Items '// loop threw all items in ListView.
            With myItem
                '// write Item & "#" & SubItems... "#" is used for when loading each line and splitting it into arrays.
                myWriter.WriteLine(myItem.Text & "#" & .SubItems(1).Text & "#" & .SubItems(2).Text & "#" & .SubItems(3).Text & "#" & .SubItems(4).Text & "#" & .SubItems(5).Text & "#" & .SubItems(6).Text & "#" & .SubItems(7).Text & "#" & .SubItems(8).Text & "#" & .SubItems(9).Text)
            End With
        Next
        myWriter.Close()

    End Sub

if u can see the "1 minutes" at the "dow30_1min",I need to do 1 minutes, 5 ,15, 30 ,1hour ,5hours, 1day, 1month
but my listview is do like this:
http://i.imgur.com/qOTGq2U.png?1

before this is like this:
Click Here

if do like the new one, this code cannot working fine right?
now i very confusing.....pls tell me this code can working or not....while u all answering this question, I will try myself

Edited by oks1998

Attachments Untitled.png 26.77 KB
2
Contributors
1
Reply
15
Views
3 Years
Discussion Span
Last Post by Minimalist
0

You are confusing me with headline of yourThread and what you wrote underneath. What is you question?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.