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

How can I set the Instrument Link to a specified color programatically?

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

    How can I set the Instrument Link to a specified color programatically?

    Hi,

    On a AddOn, I would like to set the Instrument Link to a predefined color. I do not want to restore from the saved workspace. Everything else regarding the instrument propagation is working fine, I just would like to have the AddOn always open with a specified color independently of the saved workspace.

    Thank you
    jmneto

    #2
    Hello jmneto,

    Thanks for the post.

    I looked around in Visual Studio for a while but I was unable to find any interface that exposes the actual color of the Instrument Link control. All the addon has access to is the IInstrumentProvider and IIntervalProvider interfaces that are notified once the instrument or interval is changed. There is a feature request to add access to the instrument and interval link data for manipulation through NinjaScript, I will add a vote to feature SFT-3082.

    Thanks in advance for your patience.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Please, add my vote.
      fx.practic
      NinjaTrader Ecosystem Vendor - fx.practic

      Comment


        #4
        jmneto Playing around with Intellisense in the NinjaScript Editor shows that an NTTabPage has an InstrumentLinkControl and although it has a Color, it appears it's not possible to set it directly. However, the control seems to be based on a ComboBox, so setting SelectedIndex does work!

        So, for example:
        Code:
        this.InstrumentLinkControl.SelectedIndex = 3;
        // Turns the Instrument Link to Red, where "this" is the NTTabPage you want to change
        If you are happy to manage the indices of the colours yourself, it's then quite straightforward. Note that the separator is counted in the list of indices.

        Entirely unsupported, of course, so the feature request is still necessary.

        Thanks.
        Multi-Dimensional Managed Trading
        jeronymite
        NinjaTrader Ecosystem Vendor - Mizpah Software

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by DanielTynera, Today, 01:14 AM
        0 responses
        2 views
        0 likes
        Last Post DanielTynera  
        Started by yertle, 04-18-2024, 08:38 AM
        9 responses
        40 views
        0 likes
        Last Post yertle
        by yertle
         
        Started by techgetgame, Yesterday, 11:42 PM
        0 responses
        11 views
        0 likes
        Last Post techgetgame  
        Started by sephichapdson, Yesterday, 11:36 PM
        0 responses
        2 views
        0 likes
        Last Post sephichapdson  
        Started by bortz, 11-06-2023, 08:04 AM
        47 responses
        1,615 views
        0 likes
        Last Post aligator  
        Working...
        X