Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Running C# code when the instrument has changed

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

    Running C# code when the instrument has changed

    How could I run some C# code upon the changing of an instrument on a chart?

    If this is not possible in an Indicator, then please describe how to do it in a Strategy. I just want someone to set it up so that the chart runs some code when the instrument has changed.

    #2
    Hello NinjaCustomer,

    Thanks for your post.

    If you have an instrument on the chart and indicators, when you switch instruments on the chart, all of your indicators would run again as if being applied for the first time.

    Can you clarify further what you are trying to accomplish when switching instruments?

    Comment


      #3
      great that's all i needed to know

      Comment


        #4
        where would I put user32.dll imports in a Strategy?

        Comment


          #5
          Hello NinjaCustomer,

          Thanks for your reply.

          You would need to add the file location in the "References".

          in the Ninjascript editor, open any indicator (or strategy) for editing. Right mouse click on the source code and select "References...". In the References window, left click the "add" text which will open a file explorer window, navigate to the file location, select the file "user32.dll" and click the "Open" button. This will add the reference to the reference window, click the "OK" button.

          Comment

          Latest Posts

          Collapse

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