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.
    JimNinjaTrader Customer Service

    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.
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by JoMoon2024, Today, 06:56 AM
        0 responses
        6 views
        0 likes
        Last Post JoMoon2024  
        Started by Haiasi, 04-25-2024, 06:53 PM
        2 responses
        17 views
        0 likes
        Last Post Massinisa  
        Started by Creamers, Today, 05:32 AM
        0 responses
        5 views
        0 likes
        Last Post Creamers  
        Started by Segwin, 05-07-2018, 02:15 PM
        12 responses
        1,786 views
        0 likes
        Last Post Leafcutter  
        Started by poplagelu, Today, 05:00 AM
        0 responses
        3 views
        0 likes
        Last Post poplagelu  
        Working...
        X