Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Export Market Analyzer to Excel

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

    Export Market Analyzer to Excel


    Hello NT team.

    Im a NT8 user. I need some help with the following:

    The Market Analyzer window is able to export to Excel or a .scv file, but only one record/row at a time. I want to export each item/record in the market analyzer. I would like to fill the Excel page with all record of the Market analyzer.

    There are any way to do that, any idea?

    Thanks in advance.

    Joan


    #2
    I am not sure I understand what you're experiencing. When I have a Market Analyzer with several rows, using the export feature exports all data in all rows. These are the steps I am following:Can you go into further detail about the steps you're taking which results in only one row of data being exported?

    Comment


      #3
      On this topic, is there any way to access this "export" of the Market Analyzer data from code? For example, initiate this export on new bar (assuming it's running on a daily basis)?

      Perhaps an AddOn? I wasn't able to find information on AddOns manipulating a Market Analyzer window, but I could be mistaken.

      Thank you!

      Comment


        #4
        Originally posted by neoikon View Post
        On this topic, is there any way to access this "export" of the Market Analyzer data from code? For example, initiate this export on new bar (assuming it's running on a daily basis)?

        Perhaps an AddOn? I wasn't able to find information on AddOns manipulating a Market Analyzer window, but I could be mistaken.

        Thank you!
        you could make your own indicator that runs other indicators and update a database . that is what i did and now i never have to use export. every time it updates the data is sent to my database which for me is better than excel/csv

        Comment


          #5
          Thank you for the reply. Do you have any example code you could share?

          Comment


            #6
            Originally posted by neoikon View Post
            Thank you for the reply. Do you have any example code you could share?
            I had to download some files off the internet MySql.Data.dll, MySQLInstaller.Core.dll and put those into NinjaTrader 8\bin\Custom
            Then import them as references/dependencies by right clicking in the code editor on ninjatrader

            some sample code is like


            Code:
            using System.IO;
            using MySql.Data;
            using MySql.Data.MySqlClient;
            
            private MySqlConnection conn;
            private string myConnectionString = "Server=localhost;User ID=YourUsernameHere;Password=YourPasswordHere;Data base=SchemaHere;Port=PortHere;Pooling=false";
            private MySqlCommand cmd;
            private string query;
            
            conn = new MySql.Data.MySqlClient.MySqlConnection();
            conn.ConnectionString = myConnectionString;
            conn.Open();
            
            
            double sma40 = Math.Round(SMA(Close, 40)[0],2);
            query = "update stocks set SpotPrice = @SpotPrice, sma40 = @sma40, last_updated = CURRENT_TIME where symbol = @symbol";
            cmd = new MySqlCommand();
            cmd.Connection = conn;
            cmd.CommandText = query;
            cmd.Parameters.AddWithValue("@SpotPrice", Close[0]);
            cmd.Parameters.AddWithValue("@sma40", sma40);
            cmd.Parameters.AddWithValue("@symbol", Instrument.FullName);
            c m d . E x e c u t e N o n Q u e r y ( ) ;
            conn.Close();
            the last line it wont let me type it on this forum, it blocks it for some reason so added with spaces
            Last edited by JustinCross; 09-04-2020, 08:30 PM.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by charlesugo_1, 05-26-2026, 05:03 PM
            0 responses
            75 views
            0 likes
            Last Post charlesugo_1  
            Started by DannyP96, 05-18-2026, 02:38 PM
            1 response
            152 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 05-11-2026, 05:56 AM
            0 responses
            162 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 05-10-2026, 08:12 PM
            0 responses
            100 views
            0 likes
            Last Post CarlTrading  
            Started by Hwop38, 05-04-2026, 07:02 PM
            0 responses
            289 views
            0 likes
            Last Post Hwop38
            by Hwop38
             
            Working...
            X