Di nulla! 
Puoi sperimentare anche questo:
dati storici daily, non solo il CLOSE ma tutta la barra
A mercati aperti il primo messaggio dovrebbe indicare i dati della barra in real time (quella che non si è ancora chiusa).
Il terzo messaggio: per n=0 coinciderebbe con il primo messaggio; per n=1 coinciderebbe con il secondo messaggio.

Puoi sperimentare anche questo:
dati storici daily, non solo il CLOSE ma tutta la barra
Codice:
Dim myUnderlying as TUnderlying
Dim myHistoryDataContext as THistoryDataContext
Dim myHistoricalData as THistoricalData
Dim myDataVectorDATE as TDataVector
Dim myDataVectorOPEN as TDataVector
Dim myDataVectorHIGH as TDataVector
Dim myDataVectorLOW as TDataVector
Dim myDataVectorCLOSE as TDataVector
Dim myDataVectorVOLUME as TDataVector
Dim nBarsAgo as Integer
Dim str as String
myUnderlying = CurrentStrategy.GetMainUnderlying
myHistoryDataContext = myUnderlying.AssertHistory(RTH_1D)
\'Ottenimento dei dati storici
myHistoricalData = myHistoryDataContext.HistoricalData
myDataVectorDATE = myHistoricalData.VectorDate
myDataVectorOPEN = myHistoricalData.VectorOpen
myDataVectorHIGH = myHistoricalData.VectorHigh
myDataVectorLOW = myHistoricalData.VectorLow
myDataVectorCLOSE = myHistoricalData.VectorClose
myDataVectorVOLUME = myHistoricalData.VectorVolume
\'Richiesta di mostrare i valori dell\'ultima barra o candela
str = "Ultima barra non chiusa se a mercati aperti:"
str = str & Chr(13) & Chr(10)
str = str & "Data: " & CDate(myDataVectorDATE.Last)
str = str & Chr(13) & Chr(10)
str = str & "Apertura: " & myDataVectorOPEN.Last
str = str & Chr(13) & Chr(10)
str = str & "Massimo: " & myDataVectorHIGH.Last
str = str & Chr(13) & Chr(10)
str = str & "Minimo: " & myDataVectorLOW.Last
str = str & Chr(13) & Chr(10)
str = str & "Chiusura: " & myDataVectorCLOSE.Last
str = str & Chr(13) & Chr(10)
str = str & "Volume: " & myDataVectorVOLUME.Last
ShowMessage(str)
\'Richiesta di mostrare i valori della penultima barra o candela
str = "Ultima barra sicuramente chiusa:"
str = str & Chr(13) & Chr(10)
str = str & "Data: " & CDate(myDataVectorDATE.LastClosed)
str = str & Chr(13) & Chr(10)
str = str & "Apertura: " & myDataVectorOPEN.LastClosed
str = str & Chr(13) & Chr(10)
str = str & "Massimo: " & myDataVectorHIGH.LastClosed
str = str & Chr(13) & Chr(10)
str = str & "Minimo: " & myDataVectorLOW.LastClosed
str = str & Chr(13) & Chr(10)
str = str & "Chiusura: " & myDataVectorCLOSE.LastClosed
str = str & Chr(13) & Chr(10)
str = str & "Volume: " & myDataVectorVOLUME.LastClosed
ShowMessage(str)
nBarsAgo = 2
\'Richiesta di mostrare i valori di n barre fa
str = "Dati di " & nBarsAgo & " barre fa:"
str = str & Chr(13) & Chr(10)
str = str & "Data: " & CDate(myDataVectorDATE.Value[myDataVectorDATE.Size-1-nBarsAgo])
str = str & Chr(13) & Chr(10)
str = str & "Apertura: " & myDataVectorOPEN.Value[myDataVectorOPEN.Size-1-nBarsAgo]
str = str & Chr(13) & Chr(10)
str = str & "Massimo: " & myDataVectorHIGH.Value[myDataVectorHIGH.Size-1-nBarsAgo]
str = str & Chr(13) & Chr(10)
str = str & "Minimo: " & myDataVectorLOW.Value[myDataVectorLOW.Size-1-nBarsAgo]
str = str & Chr(13) & Chr(10)
str = str & "Chiusura: " & myDataVectorCLOSE.Value[myDataVectorCLOSE.Size-1-nBarsAgo]
str = str & Chr(13) & Chr(10)
str = str & "Volume: " & myDataVectorVOLUME.Value[myDataVectorVOLUME.Size-1-nBarsAgo]
ShowMessage(str)
Il terzo messaggio: per n=0 coinciderebbe con il primo messaggio; per n=1 coinciderebbe con il secondo messaggio.




Comment