Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi-window addon button not working

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

    Multi-window addon button not working

    Hi, I'm a newbie to ninjascript and I'm learning addon development.

    My goal is really simple - Two chart windows with chart trader. Each window has a button. When the button is clicked, it should print the respective window's selected instrument.

    Please see attached screenshot.

    But for some reason when one window initializes, it overrides all the variables in the addonBase subclass and both buttons print the same instrumentName. How do I fix this?

    Please see attached addon code.



    Attached Files

    #2
    Hello skipper-flatiron-18,

    Thank you for your post.

    The prints in your screenshot don't seem to match up with the script you provided; I do not see where in your script you are generating the prints that say "OnClick - missing instrument name MNQ" and "Onclick - my symbol is MES"
    That said, I believe the underlying issue is that there is only one variable here, instrumentName, that is changing any time OnInstrumentChanged() is fired from any instrumentSelector, which would be the selector from the active chart window. To clarify, are you seeing that both buttons print the same instrument that was last selected from either instrument selector?

    For your purposes, it may make more sense to create the button in the chart trader from an indicator script that will be associated with the specific chart window that the indicator is applied to. That way, the indicator could save changes made to that specific chart trader's instrument selector and print the value from that window only. You would need to add the indicator to each chart or use a chart template that automatically applies the indicator to a new chart. We have examples of creating WFP modifications from an indicator here:


    Please let us know if we may be of further assistance.

    Comment


      #3
      Thank you. I'm not familiar with WPF or Ninjascript. I'll check out the link you provided.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      558 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      324 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      545 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      547 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X