Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Export daily and weekly data to Excel

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Excellent! Thank you very much, I'll try!

    Comment


      #17
      Originally posted by NinjaTrader_Kate View Post
      Hello 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.
      Thank you very much for your help Kate !
      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


        #18
        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
        
        }
        Please let us know if we may be of further assistance to you.
        Kate W.NinjaTrader Customer Service

        Comment


          #19
          Originally posted by NinjaTrader_Kate View Post
          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
          
          }
          Please let us know if we may be of further assistance to you.
          Thank you Kate !
          Now it works like magic !

          Comment


            #20
            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


              #21
              can you make a video of how to modify the script thank you very much

              Comment


                #22
                Hi Pascual, the forum is English only. Please repost your question in English. Unfortunately, the support team will not be able to custom modify scripts on request. Other members of the community will need to provide this service.
                Chris L.NinjaTrader Customer Service

                Comment


                  #23
                  Originally posted by Malek987 View Post

                  Thank you Kate !
                  Now it works like magic !
                  Hi Malek,

                  Could you share the code you used to get this working? I'm having trouble getting cumulative delta to print.

                  Thanks,
                  Mike

                  Comment


                    #24
                    Originally posted by NinjaTrader_Kate View Post
                    Hello 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:
                    1. Download the NinjaScripts to your desktop, keep them in the compressed .zip file.
                    2. From the Control Center window select the menu Tools > Import > NinjaScript Add-on...
                    3. Select the downloaded .zip file
                    4. 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.
                    do you know of an indicator that will do the exact opposite and read the data wrote to that excel file and input it in to a chart?

                    Comment


                      #25
                      Hi Fourcent, I apologize but I am not aware of any example that will read data from excel.
                      Chris L.NinjaTrader Customer Service

                      Comment


                        #26
                        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


                          #27
                          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 Jonafare, 12-06-2012, 03:48 PM
                          5 responses
                          3,986 views
                          0 likes
                          Last Post rene69851  
                          Started by Fitspressorest, Today, 01:38 PM
                          0 responses
                          2 views
                          0 likes
                          Last Post Fitspressorest  
                          Started by Jonker, Today, 01:19 PM
                          0 responses
                          2 views
                          0 likes
                          Last Post Jonker
                          by Jonker
                           
                          Started by futtrader, Today, 01:16 PM
                          0 responses
                          8 views
                          0 likes
                          Last Post futtrader  
                          Started by Segwin, 05-07-2018, 02:15 PM
                          14 responses
                          1,792 views
                          0 likes
                          Last Post aligator  
                          Working...
                          X