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
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Any way to interact with other charts?
Collapse
X
-
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 candlesTags: None
- Likes 1
-
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 regardsLast edited by user10; 03-28-2021, 10:52 AM.
- Likes 1
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
80 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
40 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
63 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
63 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
54 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment