Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Reading Excel file into market analyzer

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

    Reading Excel file into market analyzer

    Hello,
    I have an excel file with a list of stocks.
    For each stock I have some pre-calculated parameters.
    What I would like to do is read in this excel file to market analyzer,
    and using a custom indicator process these pre-calculated numbers and
    eventually issue an alert.
    Is there a way to do this ?
    Thanks !

    #2
    Hello Leope,

    It is possible to create an indicator that you can attach to the Market Analyzer that imports data from an external file. You can then use this data within your indicator to execute any alerts you wish to configure.

    When developing this script, I would suggest a simplistic approach, and avoid trying to understand how you can import data from an Excel Workbook file. Instead, I would suggest exporting your spreadsheet as a Unicode .TXT file, or a Comma Separated Values (.CSV) file so you can easily import data using a modified version of the SampleFileReadWrite sample. I will link it below:



    A good idea would be to populate a 2 dimensional array so you can access the data in an organized fashion within your script.

    After you have imported your data and have it managed in a useful way, you may use it to trigger sounds, messages or other alerts. You may use the alerts documented below, or you may use a drawing object for notification.

    Alerts and Debug Methods - https://ninjatrader.com/support/help...ug_methods.htm

    Drawing Objects - https://ninjatrader.com/support/help...t7/drawing.htm

    Please let me know if you have any further questions.

    Comment


      #3
      Hello Jim,
      Thanks for you answer , it is helpful !
      I am not sure I fully understand the complete solution , so it can be great if you can clarify the concept a bit , this is my understanding:
      - I have a list of stocks listed in market analyzer . For each stock there is an associated custom indicator
      - The custom indicator reads in a csv file and stores it in a 2-dimensional array containing the symbol name and data .
      is this o.k as far ?
      Now my question - on each bar , market analyzer calls the custom indicator - how does the custom indicator know on which stock it should be working on ? I mean does the market analyzer pass an argument to the indicator so that it is aware of the current symbol ?
      Also, the stocks I am looking at vary daily , this means that I have to update my market analyzer manually on a daily basis. Is it possible to import the same text file containing a list of symbols directly to market analyzer ?
      Thanks

      Comment


        #4
        Hello Leope,

        Thanks for writing back.

        Your understanding is correct. Within your indicator, you may use the Instrument object to reference the full name of the instrument or the database name. You can reference its documentation below:



        While there is not a way to import Instrument lists by file, you may create Instrument lists within the Instrument Manager and organize them for as many or as few Market Analyzer windows as you need. You may however, automate your script to refresh its loaded parameters from your exported file from Excel.

        I have more information on Instrument Lists linked below for your reference:



        If you have any other questions, please don't hesitate to ask.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        58 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        39 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        19 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        21 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        51 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X