Announcement

Collapse
No announcement yet.

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 joehanus, 03-11-2025, 03:41 PM
        6 responses
        48 views
        0 likes
        Last Post joehanus  
        Started by trimpy, 03-11-2025, 10:21 AM
        9 responses
        50 views
        0 likes
        Last Post Salahinho99  
        Started by Tyranny, Yesterday, 01:11 PM
        2 responses
        32 views
        0 likes
        Last Post Tyranny
        by Tyranny
         
        Started by JAVIER LLORDEN, 03-13-2023, 11:10 AM
        6 responses
        986 views
        0 likes
        Last Post pavan15589  
        Started by Delerium, 01-11-2022, 04:20 PM
        5 responses
        455 views
        0 likes
        Last Post wbear009  
        Working...
        X