Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

NinjaScript Addon working on Chart symbols and/or Market Watch

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

    NinjaScript Addon working on Chart symbols and/or Market Watch

    We're a group if traders working with an addon that we developed, which consists of an external program which scans thousands of symbols in realtime, using an external datafeed API, and write on a file the list of the best symbols, according to certain criteria.

    Than an addon in the trading platform reads the file with the symbol list, and puts these symbols in a predefined numbers of already opened charts.

    This addon was quite easy to develop in MT and SC, but we're stuck with Ninja Trader... perhaps we don't know where to look for.

    Imagine there is a NT workspace with, let's say, 20 opened charts. We're trying to write NinjaScript code which reads the file with the symbol list (already done) and put each of these symbols in one of the openend charts. We can't find a way to obtain the list of opened charts in the active Workspace, and change the symbol in each chart.

    We kindly ask for a solution to:
    1. obtain a list of currently opened charts in the active workspace
    2. cycle this list and change the symbol in each chart
    These looks like things already implemented internally... it's more or less the way in which symbol linking works, so there could/should be also a way to do it with NinjaScript.

    Alternatively, but less preferably, we could also solve our need with a Market Watch window, if we can find a way with NinjaScript to:
    1. create a new symbol list in Ninja Trader
    2. replace all the symbols in an already opened Market Watch with the new list, or opening a new Market Watch with all the symbols in the new symbol list.

    Thanks.

    #2
    Hello, thanks for writing in. There is no supported, documented NinjaScript code that can get all open charts in the workspace and change the chart symbol but it can be done. There is an example here showing how to get all open charts in the workspace:



    To change the symbol, you can use the fact that typing into the chart causes the instrument search to activate, e.g. you can type "MSFT" into a chart and press Enter, and the symbol will change to Microsoft. C#/.NET has a method called SendKeys() that lets you emulate keyboard typing through code.



    Now, this would require the script to run on the chart to use SendKeys(), unfortunately, I do not have any examples or guidance on how you would do this through an addon since its not documented/supported.

    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Many thanks.

      Can the SendKeys part run from inside a custom indicator attached to a chart? Will the keys be sent to the chart the indicator is attached to?

      Comment


        #4
        Hi, that is correct. The keys will be sent to the containing chart if SendKeys is called from an indicator.
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by jpapa, Today, 12:21 AM
        0 responses
        7 views
        0 likes
        Last Post jpapa
        by jpapa
         
        Started by olisav57, Yesterday, 11:54 PM
        0 responses
        2 views
        0 likes
        Last Post olisav57  
        Started by joseph323, Yesterday, 07:05 PM
        1 response
        8 views
        0 likes
        Last Post marcus2300  
        Started by cshox, 12-12-2023, 06:39 PM
        5 responses
        230 views
        0 likes
        Last Post JuanErnesto  
        Started by abandonedBaby, 06-12-2024, 12:08 PM
        5 responses
        25 views
        0 likes
        Last Post abandonedBaby  
        Working...
        X