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 elirion, Today, 09:32 PM
            0 responses
            2 views
            0 likes
            Last Post elirion
            by elirion
             
            Started by cre8able, Today, 09:15 PM
            1 response
            5 views
            0 likes
            Last Post bltdavid  
            Started by cummish, Today, 08:43 PM
            0 responses
            10 views
            0 likes
            Last Post cummish
            by cummish
             
            Started by Option Whisperer, Today, 07:58 PM
            4 responses
            21 views
            0 likes
            Last Post Option Whisperer  
            Started by ETFVoyageur, 05-07-2024, 07:05 PM
            13 responses
            87 views
            0 likes
            Last Post ETFVoyageur  
            Working...
            X