Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Export daily and weekly data to Excel
Collapse
X
-
Originally posted by NinjaTrader_Kate View PostHello Monares,
Thank you for your reply.
You could modify the exported data to contain indicator data, yes. For example, if we take a look at where the data gets assigned:
excelSheet.Cells[rowCount,1] = ToDay(Time[0]);
excelSheet.Cells[rowCount,2] = ToTime(Time[0]);
excelSheet.Cells[rowCount,3] = Open[0];
excelSheet.Cells[rowCount,4] = High[0];
excelSheet.Cells[rowCount,5] = Low[0];
excelSheet.Cells[rowCount,6] = Close[0];
excelSheet.Cells[rowCount,7] = Volume[0];
If we wanted to add a new cell for CumulativeDelta's DeltaClose value, for example, we could add a new line:
excelSheet.Cells[rowCount,8] = OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).DeltaClose[0];
Please let us know if we may be of further assistance to you.
i tried modifying the script to add the delta , but no luck for me , as the script generates the same OHLC and volume !
I even tried adding in the script some codes from the official page of the cumulative delta but no change .
Any Ideas ?
Comment
-
Hello Malek987,
Thank you for your reply.
Have you added a 1 tick data series in State.Configure? The Cumulative Delta indicator requires that be added to the hosting script that calls it.
Also, make sure you also modify the SetUpSpreadSheet method to add another column of cells and format them, and add a label for the new column:
Code:private void SetUpSpreadsheet() { OpenWorkbook(excelFile); excelSheet = (Excel._Worksheet)FindSheet(excelWorkBook, excelSheetName); if (excelSheet == null) { Alert("openError", Priority.High, "Error opening spreadsheet - check indicator parameters", "Alert1.wav", 10, Brushes.Firebrick, Brushes.Gold); } try { // Get the range of cells we want to format into an object excelRange = excelSheet.get_Range("A1","A201"); // Font Color excelRange.Font.Color = Brushes.DarkBlue.ToOle(); // Background Color excelRange.Interior.Color = Brushes.Cornsilk.ToOle(); // Bold excelRange.Font.Bold = true; // Clear the contents excelRange.ClearContents(); // Other columns excelRange = excelSheet.get_Range("B1","B201"); excelRange.Font.Color = Brushes.DarkBlue.ToOle(); excelRange.Interior.Color = Brushes.Cornsilk.ToOle(); excelRange.Font.Bold = true; excelRange.ClearContents(); excelRange = excelSheet.get_Range("C1","C201"); excelRange.Font.Color = Brushes.Black.ToOle(); excelRange.Interior.Color = Brushes.Cornsilk.ToOle(); excelRange.Font.Bold = false; excelRange.ClearContents(); excelRange = excelSheet.get_Range("D1","D201"); excelRange.Font.Color = Brushes.Black.ToOle(); excelRange.Interior.Color = Brushes.Cornsilk.ToOle(); excelRange.Font.Bold = false; excelRange.ClearContents(); excelRange = excelSheet.get_Range("E1","E201"); excelRange.Font.Color = Brushes.Black.ToOle(); excelRange.Interior.Color = Brushes.Cornsilk.ToOle(); excelRange.Font.Bold = false; excelRange.ClearContents(); excelRange = excelSheet.get_Range("F1","F201"); excelRange.Font.Color = Brushes.Black.ToOle(); excelRange.Interior.Color = Brushes.Cornsilk.ToOle(); excelRange.Font.Bold = false; excelRange.ClearContents(); excelRange = excelSheet.get_Range("G1","G201"); excelRange.Font.Color = Brushes.Red.ToOle(); excelRange.Interior.Color = Brushes.Cornsilk.ToOle(); excelRange.Font.Bold = true; excelRange.ClearContents(); [B]excelRange = excelSheet.get_Range("H1","H201"); excelRange.Font.Color = Brushes.Red.ToOle(); excelRange.Interior.Color = Brushes.Cornsilk.ToOle(); excelRange.Font.Bold = true; excelRange.ClearContents();[/B] excelApp.Visible = true; excelApp.UserControl = true; excelOpen = true; excelRange = excelSheet.get_Range("A1","H1"); excelRange.Font.Color = Brushes.Black.ToOle(); excelRange.Interior.Color = Brushes.LightGray.ToOle(); excelRange.Font.Bold = true; excelSheet.Cells[1,1] = "Date"; excelSheet.Cells[1,2] = "Time"; excelSheet.Cells[1,3] = "Open"; excelSheet.Cells[1,4] = "High"; excelSheet.Cells[1,5] = "Low"; excelSheet.Cells[1,6] = "Close"; excelSheet.Cells[1,7] = "Volume"; [B]excelSheet.Cells[1,8] = "Delta Close";[/B] } catch { Alert("Exception formatting Excel", Priority.High, "Error opening spreadsheet - check indicator parameters", "Alert1.wav", 10, Brushes.Firebrick, Brushes.Gold); } // Set up some column colours }
Kate W.NinjaTrader Customer Service
Comment
-
Originally posted by NinjaTrader_Kate View PostHello Malek987,
Thank you for your reply.
Have you added a 1 tick data series in State.Configure? The Cumulative Delta indicator requires that be added to the hosting script that calls it.
Also, make sure you also modify the SetUpSpreadSheet method to add another column of cells and format them, and add a label for the new column:
Code:private void SetUpSpreadsheet() { OpenWorkbook(excelFile); excelSheet = (Excel._Worksheet)FindSheet(excelWorkBook, excelSheetName); if (excelSheet == null) { Alert("openError", Priority.High, "Error opening spreadsheet - check indicator parameters", "Alert1.wav", 10, Brushes.Firebrick, Brushes.Gold); } try { // Get the range of cells we want to format into an object excelRange = excelSheet.get_Range("A1","A201"); // Font Color excelRange.Font.Color = Brushes.DarkBlue.ToOle(); // Background Color excelRange.Interior.Color = Brushes.Cornsilk.ToOle(); // Bold excelRange.Font.Bold = true; // Clear the contents excelRange.ClearContents(); // Other columns excelRange = excelSheet.get_Range("B1","B201"); excelRange.Font.Color = Brushes.DarkBlue.ToOle(); excelRange.Interior.Color = Brushes.Cornsilk.ToOle(); excelRange.Font.Bold = true; excelRange.ClearContents(); excelRange = excelSheet.get_Range("C1","C201"); excelRange.Font.Color = Brushes.Black.ToOle(); excelRange.Interior.Color = Brushes.Cornsilk.ToOle(); excelRange.Font.Bold = false; excelRange.ClearContents(); excelRange = excelSheet.get_Range("D1","D201"); excelRange.Font.Color = Brushes.Black.ToOle(); excelRange.Interior.Color = Brushes.Cornsilk.ToOle(); excelRange.Font.Bold = false; excelRange.ClearContents(); excelRange = excelSheet.get_Range("E1","E201"); excelRange.Font.Color = Brushes.Black.ToOle(); excelRange.Interior.Color = Brushes.Cornsilk.ToOle(); excelRange.Font.Bold = false; excelRange.ClearContents(); excelRange = excelSheet.get_Range("F1","F201"); excelRange.Font.Color = Brushes.Black.ToOle(); excelRange.Interior.Color = Brushes.Cornsilk.ToOle(); excelRange.Font.Bold = false; excelRange.ClearContents(); excelRange = excelSheet.get_Range("G1","G201"); excelRange.Font.Color = Brushes.Red.ToOle(); excelRange.Interior.Color = Brushes.Cornsilk.ToOle(); excelRange.Font.Bold = true; excelRange.ClearContents(); [B]excelRange = excelSheet.get_Range("H1","H201"); excelRange.Font.Color = Brushes.Red.ToOle(); excelRange.Interior.Color = Brushes.Cornsilk.ToOle(); excelRange.Font.Bold = true; excelRange.ClearContents();[/B] excelApp.Visible = true; excelApp.UserControl = true; excelOpen = true; excelRange = excelSheet.get_Range("A1","H1"); excelRange.Font.Color = Brushes.Black.ToOle(); excelRange.Interior.Color = Brushes.LightGray.ToOle(); excelRange.Font.Bold = true; excelSheet.Cells[1,1] = "Date"; excelSheet.Cells[1,2] = "Time"; excelSheet.Cells[1,3] = "Open"; excelSheet.Cells[1,4] = "High"; excelSheet.Cells[1,5] = "Low"; excelSheet.Cells[1,6] = "Close"; excelSheet.Cells[1,7] = "Volume"; [B]excelSheet.Cells[1,8] = "Delta Close";[/B] } catch { Alert("Exception formatting Excel", Priority.High, "Error opening spreadsheet - check indicator parameters", "Alert1.wav", 10, Brushes.Firebrick, Brushes.Gold); } // Set up some column colours }
Now it works like magic !
Comment
-
hola buenas se puede hacer un video de como hacer esto......
Hola Malek987,
gracias por tu respuesta.
żHa agregado una serie de datos de 1 tick en State.Configure? El indicador Delta acumulativo requiere que se agregue al script de alojamiento que lo llama.
Además, asegúrese de modificar también el método SetUpSpreadSheet para agregar otra columna de celdas y formatearlas, y agregue una etiqueta para la nueva columna:
Código:
SetUpSpreadsheet vacío privado () { OpenWorkbook (archivo de Excel); excelSheet = (Excel._Worksheet)FindSheet(excelWorkBook, excelSheetName); si (hoja de Excel == nulo) { Alert("openError", Priority.High, "Error al abrir la hoja de cálculo: verifique los parámetros del indicador", "Alert1.wav", 10, Brushes.Firebrick, Brushes.Gold); } probar { // Obtener el rango de celdas que queremos formatear en un objeto excelRango = excelSheet.get_Range("A1","A201"); // Color de fuente excelRange.Font.Color = Brushes.DarkBlue.ToOle(); // Color de fondo excelRange.Interior.Color = Brushes.Cornsilk.ToOle(); // Audaz excelRange.Font.Bold = verdadero; // Limpiar el contenido excelRange.ClearContents(); // Otras columnas excelRango = excelSheet.get_Range("B1","B201"); excelRange.Font.Color = Brushes.DarkBlue.ToOle(); excelRange.Interior.Color = Brushes.Cornsilk.ToOle(); excelRange.Font.Bold = verdadero; excelRange.ClearContents(); excelRango = excelSheet.get_Range("C1","C201"); excelRange.Font.Color = Brushes.Black.ToOle(); excelRange.Interior.Color = Brushes.Cornsilk.ToOle(); excelRange.Font.Bold = false; excelRange.ClearContents(); excelRango = excelSheet.get_Range("D1","D201"); excelRange.Font.Color = Brushes.Black.ToOle(); excelRange.Interior.Color = Brushes.Cornsilk.ToOle(); excelRange.Font.Bold = false; excelRange.ClearContents(); excelRange = excelSheet.get_Range("E1","E201"); excelRange.Font.Color = Brushes.Black.ToOle(); excelRange.Interior.Color = Brushes.Cornsilk.ToOle(); excelRange.Font.Bold = false; excelRange.ClearContents(); excelRango = excelSheet.get_Range("F1","F201"); excelRange.Font.Color = Brushes.Black.ToOle(); excelRange.Interior.Color = Brushes.Cornsilk.ToOle(); excelRange.Font.Bold = false; excelRange.ClearContents(); excelRango = excelSheet.get_Range("G1","G201"); excelRange.Font.Color = Brushes.Red.ToOle(); excelRange.Interior.Color = Brushes.Cornsilk.ToOle(); excelRange.Font.Bold = verdadero; excelRange.ClearContents(); excelRango = excelSheet.get_Range("H1","H201"); excelRange.Font.Color = Brushes.Red.ToOle(); excelRange.Interior.Color = Brushes.Cornsilk.ToOle(); excelRange.Font.Bold = verdadero; excelRange.ClearContents(); excelApp.Visible = verdadero; excelApp.UserControl = verdadero; excelOpen = verdadero; excelRango = excelSheet.get_Range("A1","H1"); excelRange.Font.Color = Brushes.Black.ToOle(); excelRange.Interior.Color = Brushes.LightGray.ToOle(); excelRange.Font.Bold = verdadero; excelSheet.Cells[1,1] = "Fecha"; excelSheet.Cells[1,2] = "Tiempo"; excelSheet.Cells[1,3] = "Abrir"; excelSheet.Cells[1,4] = "Alto"; excelSheet.Cells[1,5] = "Bajo"; excelSheet.Cells[1,6] = "Cerrar"; excelSheet.Cells[1,7] = "Volumen"; excelSheet.Cells[1,8] = "Cierre delta"; } captura { Alert("Excepción al formatear Excel", Priority.High, "Error al abrir la hoja de cálculo - comprobar los parámetros del indicador", "Alert1.wav", 10, Brushes.Firebrick, Brushes.Gold); } // Configurar algunos colores de columna }Háganos saber si podemos ser de más ayuda para usted.
Comment
-
-
-
Originally posted by NinjaTrader_Kate View PostHello U0000999,
Thank you for your note.
While it wouldn't technically be supported, there's an indicator on the User App Share that can accomplish this for you. This indicator is publicly available on our NinjaTrader Ecosystem website:A note with this one that you do need to physically create the excel file for the indicator to write to prior to running the indicator.
Here is a basic guideline of how to import NinjaScript add-ons in NinjaTrader 8:
Note — To import NinjaScripts you will need the original .zip file.
To Import:- Download the NinjaScripts to your desktop, keep them in the compressed .zip file.
- From the Control Center window select the menu Tools > Import > NinjaScript Add-on...
- Select the downloaded .zip file
- NinjaTrader will then confirm if the import has been successful.
Critical - Specifically for some NinjaScripts, it will prompt that you are running newer versions of @SMA, @EMA, etc. and ask if you want to replace, press 'No'
Once installed, you may add the indicator to a chart by:- Right click your chart > Indicators... > Select the Indicator from the 'Available' list on the left > Add > OK
Please let me know if I can be of further assistance.
The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.
Comment
-
Hi!
Thanks a lot you all for your efforts to improve BigMike
I would like to know how to get all data from any indicator (not only Open, High, Low, Close, Date, Time and Volume).
Best regards
Comment
-
Hi Fourcent,
If the file is saved as an .cvs from excel, this is a basic text file that can be read with StreamReader.
RAFAEL_ROLDAN,
Anything that is declared with the public access modifier can be accessed when calling an indicator.
If the values are not series and are assigned values from OnBarUpdate(), call <indicator>.Update() before retrieving the value.
Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by ZeroKuhl, Today, 04:31 PM
|
0 responses
7 views
0 likes
|
Last Post
by ZeroKuhl
Today, 04:31 PM
|
||
Started by Vulgoth_t_Destroyer, 05-09-2022, 04:45 PM
|
54 responses
5,336 views
0 likes
|
Last Post
by Gaterz
Today, 04:29 PM
|
||
Started by ETFVoyageur, 05-07-2024, 07:05 PM
|
11 responses
74 views
0 likes
|
Last Post
by -=Edge=-
Today, 04:27 PM
|
||
Started by _Zero_, 04-10-2020, 03:21 PM
|
145 responses
7,900 views
6 likes
|
Last Post
by johng2
Today, 04:19 PM
|
||
Started by TheTradingMantis, 01-19-2023, 02:05 AM
|
43 responses
921 views
0 likes
|
Last Post
by jmagaia
Today, 04:13 PM
|
Comment