Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Synchronize indicator on all charts

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

    Synchronize indicator on all charts

    I have an indicator that I use on several charts with different timeframes. Is it possible that when I click on one of the buttons, in a chart, the information of that button is changed in all charts?


    so in the photo example, if I click on the long button then both charts set the button to long
    How can I do it?

    #2
    Hello lju45,

    That is not really something which general NinjaScript could accomplish, each indicator is a new instance so they are all separate. You can use a C# concept like static for that type of use which makes a variable part of the type instead of an instance. You can research C# static further to see if that would be useful for your specific use case.

    https://docs.microsoft.com/en-us/dot...eywords/static

    Static more or less makes a variable into a single source instead of having a different value for each specific instance that is running. This is a concept we do not suggest using in NinjaScript unless you have learned about static and are aware how it works, this will have adverse affects on the platform if you use it incorrectly on properties that should be isolated to a specific scripts instance.

    For your use case it could be suggested to make a public static property inside your indicator class which holds a value. In the button click you could update that value, any other script which references that static property by its Type.PropertyName format could see that value. This is not an event so other scripts would have to monitor for changes if they want to update something locally.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    661 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    375 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    110 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    574 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    580 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X