Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Any way to interact with other charts?

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

    Any way to interact with other charts?

    I know this is probably really complicated, but has anyone come up with a way to interact with multiple charts within NinjaScript?

    I can imagine creating some type of web services with some type of state service that each chart can ping the services with some data on bar change so that other charts can call that server, but wondering if anyone has every tried or done anything like this? This would largely be for working with multiple timeframes without having to bog down higher timeframes with smaller candles

    #2
    Hello ErikY, thanks for posting.

    There is nothing supported that will make multiple charts communicate with each other. This thread will remain open for other members of the forum to provide input.

    Kind regards.

    Comment


      #3
      Hello ErikY,

      you can exchange data between two "charts" using a public static array.

      Example:

      Strategy 1 (Chart 1) "SendData"
      Init: public static bool [] SendArray = new bool [10000];
      OnBarUpdate(): SendArray[CurrentBar] = yourBoolToSendToReceiveData;

      ======
      Strategy 2 (Chart2) "ReceiveData"
      Init: private bool [] ReceiveArray;
      DataLoaded: ReceiveArray = new bool [10000];
      OnBarUpdate(): ReceiveArray[0] = SendData.SendArray[CurrentBar];

      You can transfer 10000 historical data if you first open the SendData strategy and then (!) the ReceiveData strategy.
      The number of data in the SendData and ReceiveData strategies must be identical for the historical data.
      For realtime data a public static variable is sufficient.

      Kind regards
      Last edited by user10; 03-28-2021, 10:52 AM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      68 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      151 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      162 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      100 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      288 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X