Hallo,
in meinem aktuellen projekt habe ich irrsinnige timingprobleme.
Ich habe ein Tool geschrieben, das mit nicht typisierten Dataset sowie Tabellen arbeitet. Im ersten schritt habe ich alles in xml Dateien gespeichert. Was gut ging aber Verwaltungstechnisch nicht mehr überschaubar sowie den Ram schon in der Anfangsphase auf 3GB belastet hat. Hier wurden grade mal 5 von 20 Tabellen erstellt und ausgelesen. Es werden zum schluss ca 20 sein also würde der Ram mit ca. 12 GB belastet werden. Zuviel und ich brauche ja nicht alle daten.Desweiteren dauert das Speicher der Daten jedesmal ca. 40sek. zu lange.
Also war die Schlussvolgerung ich übertrage die vorhandenen Daten in eine SQL Datenbank und lade mir am anfang nur die benötigten Daten. Das funktioniert auch und die Arbeitspeicher Auslastung liegt bei ca. 800MB und das speichern der daten ist genial kurz mit unter 1sek. . soweit super!!!!
Jetzt dauert aber die verarbeitung der Daten 55sek. mit der SQL variante und mit der xml Variante nur 3 sek.! Kann einer sagen woran das liegen kann.
anbei der komplette Code meiner SQL-Klasse! Es betrifft die "AddnewHistoryData" Sub.
Schonmal danke für jede Idee
Spoiler anzeigen
*Spoiler eingefügt" ~NoFear23m
in meinem aktuellen projekt habe ich irrsinnige timingprobleme.
Ich habe ein Tool geschrieben, das mit nicht typisierten Dataset sowie Tabellen arbeitet. Im ersten schritt habe ich alles in xml Dateien gespeichert. Was gut ging aber Verwaltungstechnisch nicht mehr überschaubar sowie den Ram schon in der Anfangsphase auf 3GB belastet hat. Hier wurden grade mal 5 von 20 Tabellen erstellt und ausgelesen. Es werden zum schluss ca 20 sein also würde der Ram mit ca. 12 GB belastet werden. Zuviel und ich brauche ja nicht alle daten.Desweiteren dauert das Speicher der Daten jedesmal ca. 40sek. zu lange.
Also war die Schlussvolgerung ich übertrage die vorhandenen Daten in eine SQL Datenbank und lade mir am anfang nur die benötigten Daten. Das funktioniert auch und die Arbeitspeicher Auslastung liegt bei ca. 800MB und das speichern der daten ist genial kurz mit unter 1sek. . soweit super!!!!
Jetzt dauert aber die verarbeitung der Daten 55sek. mit der SQL variante und mit der xml Variante nur 3 sek.! Kann einer sagen woran das liegen kann.
anbei der komplette Code meiner SQL-Klasse! Es betrifft die "AddnewHistoryData" Sub.
Schonmal danke für jede Idee
Quellcode
- Option Strict On
- Imports System.IO
- Imports System.Windows.Forms
- Imports System.Linq
- Imports System.Data
- Imports System.Data.SqlClient
- Imports System.Data.Entity
- Imports fxcore2
- Imports Trading_Calculators
- Public Class SQL_Allgemeine_Funktion
- Dim ClassSettings_DS As New ClassSettings
- Public SQL_All_Instruments_Table As DataTable
- Public SQL_Connection As New SqlConnection
- Public SQL_AdapterList As New Dictionary(Of String, SqlDataAdapter)
- Public Instrument_History_DS As New Dictionary(Of String, DataSet)
- Public AllInstrument_Table As DataTable
- Dim SQL_Adapter_AllInstrument_Table As ClassSettingsTableAdapters.All_Instrument_TableTableAdapter
- Dim TradingDaysInRAM As Integer = 1825 '5Jahre
- Dim Trading_Calc_ALGFunk As New Trading_Calculators.Allgemeine_Funktionen
- ''' <summary>
- ''' Erstellt ein Verbindung zur Datenbank her
- ''' </summary>
- Public Sub ConnectToDatabase()
- Dim Connection_String As String = "Data Source = DESK_PC_0001 \ TZCADDESIGNSQL;Initial Catalog=Historical_Database;Integrated Security=True"
- SQL_Connection.ConnectionString = Connection_String
- SQL_Connection.Open()
- AllInstrument_Table = ClassSettings_DS.Tables("All_Instrument_Table")
- SQL_Adapter_AllInstrument_Table = New ClassSettingsTableAdapters.All_Instrument_TableTableAdapter
- SQL_Adapter_AllInstrument_Table.Fill(ClassSettings_DS.All_Instrument_Table)
- For Each Selectedrow As DataRow In AllInstrument_Table.Rows
- Dim NewDataset As New DataSet
- Instrument_History_DS.Add(CStr(Selectedrow("Instrument")).Replace("/", "_").Trim, NewDataset)
- Next
- End Sub
- ''' <summary>
- ''' Wird ein neues Instrument gelesen, wird diese neu in der Datenbank erstellt danach laden der vorhandenen Tabellen
- ''' </summary>
- Public Sub AddInstrumentsToTableSQL(ByVal InstrumentList As List(Of List(Of String)))
- For Each DetailInstrument As List(Of String) In InstrumentList
- Dim addInstrument As Boolean = True
- Dim TabelRow As DataRow
- For Each SelectedRow As DataRow In AllInstrument_Table.Rows
- If CStr(SelectedRow("Instrument")).Trim = DetailInstrument(0) Then
- addInstrument = False
- TabelRow = SelectedRow
- Exit For
- End If
- Next
- If addInstrument Then
- Dim NewRow As DataRow = AllInstrument_Table.NewRow
- NewRow.BeginEdit()
- NewRow("Instrument_ID") = DetailInstrument(4)
- NewRow("Instrument") = DetailInstrument(0)
- NewRow("AskTradeable") = DetailInstrument(1)
- NewRow("BidTradeable") = DetailInstrument(2)
- NewRow("SubscriptionState") = DetailInstrument(3)
- NewRow("Table_M5") = Trading_Calc_ALGFunk.GetInstrumentTableName(DetailInstrument(0)) & "_M5"
- NewRow("Table_M15") = Trading_Calc_ALGFunk.GetInstrumentTableName(DetailInstrument(0)) & "_M15"
- NewRow("Table_M30") = Trading_Calc_ALGFunk.GetInstrumentTableName(DetailInstrument(0)) & "_M30"
- NewRow("Table_M60") = Trading_Calc_ALGFunk.GetInstrumentTableName(DetailInstrument(0)) & "_M60"
- NewRow.EndEdit()
- AllInstrument_Table.Rows.Add(NewRow)
- CreateInstrumentTabel(CStr(NewRow("Table_M5")))
- CreateInstrumentTabel(CStr(NewRow("Table_M15")))
- CreateInstrumentTabel(CStr(NewRow("Table_M30")))
- CreateInstrumentTabel(CStr(NewRow("Table_M60")))
- SQL_Adapter_AllInstrument_Table.Update(Me.ClassSettings_DS.All_Instrument_Table)
- End If
- Next
- LoadAllInstrument()
- End Sub
- ''' <summary>
- ''' Lädt alle Instrumente aus der SQL Datenbank in den Cash
- ''' </summary>
- Public Sub LoadAllInstrument()
- Dim AllTables As DataTable = SQL_Connection.GetSchema("Tables")
- Dim SelectionDay As Date = System.DateTime.UtcNow
- For Each SelectedRow As DataRow In AllTables.Rows
- If CStr(SelectedRow(2)) Like "*M5" Or CStr(SelectedRow(2)) Like "*M15" Or CStr(SelectedRow(2)) Like "*M30" _
- Or CStr(SelectedRow(2)) Like "*M60" Then
- Dim Temp_SQL_Adapter As SqlDataAdapter = New SqlDataAdapter("Select * From " & CStr(SelectedRow(2)) & " Where Time >= '" & SelectDaysInTable(CStr(SelectedRow(2))) & "'", SQL_Connection) '
- SQL_AdapterList.Add(CStr(SelectedRow(2)), Temp_SQL_Adapter)
- Dim Instrument_DS As DataSet = Instrument_History_DS.First(Function(match As KeyValuePair(Of String, DataSet)) match.Key = GetInstrumentName(CStr(SelectedRow(2)))).Value
- Temp_SQL_Adapter.FillSchema(Instrument_DS, SchemaType.Source)
- Temp_SQL_Adapter.Fill(Instrument_DS, CStr(SelectedRow(2)))
- End If
- Next
- End Sub
- Private Function SelectDaysInTable(ByVal InstrumentName As String) As Date
- Dim SelectionDay As Date = System.DateTime.UtcNow
- Dim InstrumentTempName As String = GetInstrumentName(InstrumentName)
- Dim ReturningDate As Date
- For Each SelectedRow_Temp As DataRow In AllInstrument_Table.Rows
- Dim TempInstrument As String = CStr(SelectedRow_Temp("Instrument")).Replace("/", "_").Trim
- If InstrumentTempName = TempInstrument Then
- ReturningDate = CDate(SelectedRow_Temp("LastAddDate")).AddDays(-(TradingDaysInRAM))
- Exit For
- End If
- Next
- Return ReturningDate
- End Function
- Private Function GetInstrumentName(ByVal InstrumentName As String) As String
- Dim InstrumentTempName As String = ""
- If CStr(InstrumentName) Like "*M5" Then
- InstrumentTempName = CStr(InstrumentName).Replace("_M5", "")
- ElseIf CStr(InstrumentName) Like "*M15" Then
- InstrumentTempName = CStr(InstrumentName).Replace("_M15", "")
- ElseIf CStr(InstrumentName) Like "*M30" Then
- InstrumentTempName = CStr(InstrumentName).Replace("_M30", "")
- ElseIf CStr(InstrumentName) Like "*M60" Then
- InstrumentTempName = CStr(InstrumentName).Replace("_M60", "")
- End If
- Return InstrumentTempName
- End Function
- Private Sub CreateInstrumentTabel(ByVal TableName As String)
- Dim CreateTable As String = "CREATE TABLE " & TableName
- CreateTable = CreateTable & "(Time datetime NOT Null,"
- CreateTable = CreateTable & "ASK NUMERIC(18, 7) NULL,"
- CreateTable = CreateTable & "ASKClose NUMERIC(18, 7) NULL,"
- CreateTable = CreateTable & "ASKHigh NUMERIC(18, 7) NULL,"
- CreateTable = CreateTable & "ASKLow NUMERIC(18, 7) NULL,"
- CreateTable = CreateTable & "ASKOpen NUMERIC(18, 7) NULL,"
- CreateTable = CreateTable & "BID NUMERIC(18, 7) NULL,"
- CreateTable = CreateTable & "BIDClose NUMERIC(18, 7) NULL,"
- CreateTable = CreateTable & "BIDHigh NUMERIC(18, 7) NULL,"
- CreateTable = CreateTable & "BIDLow NUMERIC(18, 7) NULL,"
- CreateTable = CreateTable & "BIDOpen NUMERIC(18, 7) NULL,"
- CreateTable = CreateTable & "Volume int NULL)"
- Dim ExCommand As SqlCommand = New SqlCommand(CreateTable, SQL_Connection)
- ExCommand.ExecuteNonQuery()
- ChangePrimarykey(TableName, "Time")
- End Sub
- Public Sub AddOldHistoryToSQL(ByVal OlDatsets As List(Of DataSet))
- For Each SelectedDataset As DataSet In OlDatsets
- Dim InstrumentName As String = SelectedDataset.DataSetName
- For Each SelectedTabel As DataTable In SelectedDataset.Tables
- Dim SQLTableName As String = InstrumentName & "_" & SelectedTabel.TableName
- Dim Instrument_DS As DataSet = Instrument_History_DS.First(Function(match As KeyValuePair(Of String, DataSet)) match.Key = InstrumentName).Value
- For Each DB_Instrument_table As DataTable In Instrument_DS.Tables
- If DB_Instrument_table.TableName = SQLTableName Then
- Dim SQL_DataAdapter As SqlDataAdapter = SQL_AdapterList.First(Function(match As KeyValuePair(Of String, SqlDataAdapter)) match.Key = SQLTableName).Value
- Dim mycb As New SqlCommandBuilder(SQL_DataAdapter)
- For Each SelectedRows As DataRow In SelectedTabel.Rows
- Dim NewRow As DataRow = DB_Instrument_table.NewRow
- NewRow.BeginEdit()
- NewRow("Time") = SelectedRows("Time")
- NewRow("ASK") = SelectedRows("ASK")
- NewRow("ASKClose") = SelectedRows("ASKClose")
- NewRow("ASKHigh") = SelectedRows("ASKHigh")
- NewRow("ASKLow") = SelectedRows("ASKLow")
- NewRow("ASKOpen") = SelectedRows("ASKOpen")
- NewRow("BID") = SelectedRows("BID")
- NewRow("BIDClose") = SelectedRows("BIDClose")
- NewRow("BIDHigh") = SelectedRows("BIDHigh")
- NewRow("BIDLow") = SelectedRows("BIDLow")
- NewRow("BIDOpen") = SelectedRows("BIDOpen")
- NewRow("Volume") = SelectedRows("Volume")
- NewRow.EndEdit()
- DB_Instrument_table.Rows.Add(NewRow)
- Next
- SQL_DataAdapter.Update(DB_Instrument_table)
- Exit For
- End If
- Next
- Next
- Next
- End Sub
- Public Sub AddNewColumnToTabel(ByVal TableName As String, ByVal ColumnName As String, ByVal SQLDataType As String, Optional ByVal AllowDBNull As String = "NULL")
- Using cmd = New SqlCommand()
- cmd.Connection = SQL_Connection
- cmd.CommandText = "ALTER TABLE " & TableName & " ADD " & ColumnName & " " & SQLDataType & " " & AllowDBNull
- cmd.CommandType = CommandType.Text
- cmd.ExecuteNonQuery()
- End Using
- End Sub
- Public Sub ChangePrimarykey(ByVal TableName As String, ByVal ColumnName As String)
- Try
- Using cmd = New SqlCommand()
- cmd.Connection = SQL_Connection
- cmd.CommandText = "ALTER TABLE " & TableName & " ADD PRIMARY KEY (" & ColumnName & ")"
- cmd.CommandType = CommandType.Text
- cmd.ExecuteNonQuery()
- End Using
- Catch ex As Exception
- End Try
- End Sub
- ''' <summary>
- ''' Prüft und fügt neue Historische Daten Hinzu
- ''' </summary>
- Public Sub AddnewHistoryData(ByVal Instrument As String, ByVal HistoryList As List(Of List(Of Object)))
- Dim NormalInstrumentName As String = Instrument
- Dim NewRowsAdded As Boolean = False
- Dim lastAddedDate As Date = Nothing
- Instrument = Trading_Calc_ALGFunk.GetInstrumentTableName(Instrument)
- Dim Instrument_DS As DataSet = Instrument_History_DS.First(Function(match As KeyValuePair(Of String, DataSet)) match.Key = Instrument).Value
- Dim TempInstrumentTable_M5 As DataTable = Instrument_DS.Tables(Instrument & "_M5")
- Dim TempInstrumentTable_M15 As DataTable = Instrument_DS.Tables(Instrument & "_M15")
- Dim TempInstrumentTable_M30 As DataTable = Instrument_DS.Tables(Instrument & "_M30")
- Dim TempInstrumentTable_M60 As DataTable = Instrument_DS.Tables(Instrument & "_M60")
- Dim Secondtime As Date = System.DateTime.Now
- Dim timespan_temp As TimeSpan
- For Each Detaillist As List(Of Object) In HistoryList
- Dim AddNewRow As Boolean = True
- Dim Foundrow() As DataRow = TempInstrumentTable_M5.Select("Time = '" & CDate(Detaillist(0)) & "'")
- For Each SelectedRow As DataRow In Foundrow
- If CDate(SelectedRow("Time")) = CDate(Detaillist(0)) Then
- AddNewRow = False
- Exit For
- End If
- Next
- If AddNewRow Then
- Dim NewRow As DataRow = TempInstrumentTable_M5.NewRow
- NewRow.BeginEdit()
- lastAddedDate = CDate(Detaillist(0))
- NewRow("Time") = CDate(Detaillist(0))
- NewRow("ASK") = Trading_Calc_ALGFunk.AuswahlWaehrung(Instrument, CDbl(Detaillist(1)))
- NewRow("ASKClose") = Trading_Calc_ALGFunk.AuswahlWaehrung(Instrument, CDbl(Detaillist(2)))
- NewRow("ASKHigh") = Trading_Calc_ALGFunk.AuswahlWaehrung(Instrument, CDbl(Detaillist(3)))
- NewRow("ASKLow") = Trading_Calc_ALGFunk.AuswahlWaehrung(Instrument, CDbl(Detaillist(4)))
- NewRow("ASKOpen") = Trading_Calc_ALGFunk.AuswahlWaehrung(Instrument, CDbl(Detaillist(5)))
- NewRow("BID") = Trading_Calc_ALGFunk.AuswahlWaehrung(Instrument, CDbl(Detaillist(6)))
- NewRow("BIDClose") = Trading_Calc_ALGFunk.AuswahlWaehrung(Instrument, CDbl(Detaillist(7)))
- NewRow("BIDHigh") = Trading_Calc_ALGFunk.AuswahlWaehrung(Instrument, CDbl(Detaillist(8)))
- NewRow("BIDLow") = Trading_Calc_ALGFunk.AuswahlWaehrung(Instrument, CDbl(Detaillist(9)))
- NewRow("BIDOpen") = Trading_Calc_ALGFunk.AuswahlWaehrung(Instrument, CDbl(Detaillist(10)))
- NewRow("Volume") = CInt(Detaillist(11))
- NewRow.EndEdit()
- TempInstrumentTable_M5.Rows.Add(NewRow)
- Dim M15Thread = New System.Threading.Thread(Sub() Me.AddNewTimeSteps(15, NewRow, Instrument, TempInstrumentTable_M15))
- Dim M30Thread = New System.Threading.Thread(Sub() Me.AddNewTimeSteps(30, NewRow, Instrument, TempInstrumentTable_M30))
- Dim M60Thread = New System.Threading.Thread(Sub() Me.AddNewTimeSteps(60, NewRow, Instrument, TempInstrumentTable_M60))
- M15Thread.Start()
- M30Thread.Start()
- M60Thread.Start()
- M15Thread.Join()
- M30Thread.Join()
- M60Thread.Join()
- NewRowsAdded = True
- End If
- Next
- timespan_temp = System.DateTime.Now - Secondtime
- Debug.Print("Time All Data: " & timespan_temp.TotalSeconds)
- Dim thirdtime As DateTime = System.DateTime.Now
- If NewRowsAdded Then
- UpdateInstrumentInSQLDatabase(Instrument, "_M5")
- UpdateInstrumentInSQLDatabase(Instrument, "_M15")
- UpdateInstrumentInSQLDatabase(Instrument, "_M30")
- UpdateInstrumentInSQLDatabase(Instrument, "_M60")
- ChangeLastAddedDate(NormalInstrumentName, lastAddedDate)
- End If
- timespan_temp = System.DateTime.Now - thirdtime
- Debug.Print("Time SQL: " & timespan_temp.TotalSeconds)
- End Sub
- Private Sub ChangeLastAddedDate(ByVal Instrument As String, ByVal LastDate As Date)
- Try
- For Each SelectedRow As DataRow In AllInstrument_Table.Rows
- If CStr(SelectedRow("Instrument")).Trim = Instrument Then
- SelectedRow.BeginEdit()
- SelectedRow("LastAddDate") = LastDate
- SelectedRow.EndEdit()
- Exit For
- End If
- Next
- SQL_Adapter_AllInstrument_Table.Update(Me.ClassSettings_DS.All_Instrument_Table.Select("", "", DataViewRowState.ModifiedCurrent))
- Catch ex As Exception
- MessageBox.Show(ex.Message & vbNewLine & ex.Source)
- End Try
- End Sub
- Private Sub UpdateInstrumentInSQLDatabase(ByVal Instrument As String, ByVal Timestep As String)
- Try
- Dim SQL_DataAdapter As SqlDataAdapter = SQL_AdapterList.First(Function(match As KeyValuePair(Of String, SqlDataAdapter)) match.Key = Instrument & Timestep).Value
- Dim mycb As New SqlCommandBuilder(SQL_DataAdapter)
- Dim Instrument_DS As DataSet = Instrument_History_DS.First(Function(match As KeyValuePair(Of String, DataSet)) match.Key = Instrument).Value
- SQL_DataAdapter.Update(Instrument_DS.Tables(Instrument & Timestep).Select("", "", DataViewRowState.ModifiedCurrent))
- SQL_DataAdapter.Update(Instrument_DS.Tables(Instrument & Timestep).Select("", "", DataViewRowState.Added))
- Catch ex As Exception
- MessageBox.Show(ex.Message & vbNewLine & ex.Source)
- End Try
- End Sub
- ''' <summary>
- ''' Fügt neue Historische Daten in anderen Zeitlinien hinzu
- ''' </summary>
- Private Sub AddNewTimeSteps(ByVal Timestep As Integer, ByVal LastRowTimeM5 As DataRow, ByVal Instrument As String, ByVal Instrument_Table_CurrentTimeStep As DataTable)
- Dim addingtime As New List(Of Integer)
- Dim NewRowTime As New List(Of Integer)
- Dim EndTime As New List(Of Integer)
- If Timestep = 15 Then
- NewRowTime.Add(0)
- addingtime.Add(5)
- EndTime.Add(10)
- NewRowTime.Add(15)
- addingtime.Add(20)
- EndTime.Add(25)
- NewRowTime.Add(30)
- addingtime.Add(35)
- EndTime.Add(40)
- NewRowTime.Add(45)
- addingtime.Add(50)
- EndTime.Add(55)
- End If
- If Timestep = 30 Then
- NewRowTime.Add(0)
- addingtime.Add(5)
- addingtime.Add(10)
- addingtime.Add(15)
- addingtime.Add(20)
- EndTime.Add(25)
- NewRowTime.Add(30)
- addingtime.Add(35)
- addingtime.Add(40)
- addingtime.Add(45)
- addingtime.Add(50)
- EndTime.Add(55)
- End If
- If Timestep = 60 Then
- NewRowTime.Add(0)
- addingtime.Add(5)
- addingtime.Add(10)
- addingtime.Add(15)
- addingtime.Add(20)
- addingtime.Add(25)
- addingtime.Add(30)
- addingtime.Add(35)
- addingtime.Add(40)
- addingtime.Add(45)
- addingtime.Add(50)
- EndTime.Add(55)
- End If
- Dim SelectionString As String = ""
- For Each SelectedInt As Integer In NewRowTime
- If CDate(LastRowTimeM5("Time")).Minute = SelectedInt Then
- SelectionString = "New"
- Exit For
- End If
- Next
- For Each SelectedInt As Integer In addingtime
- If CDate(LastRowTimeM5("Time")).Minute = SelectedInt Then
- SelectionString = "Add"
- Exit For
- End If
- Next
- For Each SelectedInt As Integer In EndTime
- If CDate(LastRowTimeM5("Time")).Minute = SelectedInt Then
- SelectionString = "Last"
- Exit For
- End If
- Next
- If SelectionString = "New" Then
- Dim NewRow As DataRow = Instrument_Table_CurrentTimeStep.NewRow
- NewRow.BeginEdit()
- NewRow("Time") = LastRowTimeM5("Time")
- NewRow("ASK") = LastRowTimeM5("ASK")
- NewRow("ASKClose") = LastRowTimeM5("ASKClose")
- NewRow("ASKHigh") = LastRowTimeM5("ASKHigh")
- NewRow("ASKLow") = LastRowTimeM5("ASKLow")
- NewRow("ASKOpen") = LastRowTimeM5("ASKOpen")
- NewRow("BID") = LastRowTimeM5("BID")
- NewRow("BIDClose") = LastRowTimeM5("BIDClose")
- NewRow("BIDHigh") = LastRowTimeM5("BIDHigh")
- NewRow("BIDLow") = LastRowTimeM5("BIDLow")
- NewRow("BIDOpen") = LastRowTimeM5("BIDOpen")
- NewRow("Volume") = LastRowTimeM5("Volume")
- NewRow.EndEdit()
- ChangeOldClose(CDbl(LastRowTimeM5("ASKOpen")), CDbl(LastRowTimeM5("BIDOpen")), Instrument_Table_CurrentTimeStep)
- Instrument_Table_CurrentTimeStep.Rows.Add(NewRow)
- End If
- If SelectionString = "Add" Or SelectionString = "Last" Then
- Dim NewRow As DataRow = Instrument_Table_CurrentTimeStep.Rows(Instrument_Table_CurrentTimeStep.Rows.Count - 1)
- NewRow.BeginEdit()
- If CDbl(NewRow("ASKHigh")) <= CDbl(LastRowTimeM5("ASKHigh")) Then
- NewRow("ASKHigh") = LastRowTimeM5("ASKHigh")
- End If
- If CDbl(NewRow("ASKLow")) >= CDbl(LastRowTimeM5("ASKLow")) Then
- NewRow("ASKLow") = LastRowTimeM5("ASKLow")
- End If
- If CDbl(NewRow("BIDHigh")) <= CDbl(LastRowTimeM5("BIDHigh")) Then
- NewRow("BIDHigh") = LastRowTimeM5("BIDHigh")
- End If
- If CDbl(NewRow("BIDLow")) >= CDbl(LastRowTimeM5("BIDLow")) Then
- NewRow("BIDLow") = LastRowTimeM5("BIDLow")
- End If
- NewRow("Volume") = CInt(NewRow("Volume")) + CInt(LastRowTimeM5("Volume"))
- If SelectionString = "Last" Then
- NewRow("ASKClose") = LastRowTimeM5("ASKClose")
- NewRow("BIDClose") = LastRowTimeM5("BIDClose")
- End If
- NewRow.EndEdit()
- End If
- End Sub
- Private Sub ChangeOldClose(ByVal AskClose As Double, ByVal BidClose As Double, ByVal Instrument_Table As DataTable)
- If Instrument_Table.Rows.Count > 1 Then
- Dim NewRow As DataRow = Instrument_Table.Rows(Instrument_Table.Rows.Count - 1)
- NewRow.BeginEdit()
- NewRow("ASKClose") = AskClose
- NewRow("BIDClose") = BidClose
- NewRow.EndEdit()
- End If
- End Sub
- End Class
*Spoiler eingefügt" ~NoFear23m
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „Nofear23m“ ()