Thank you
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
What is the preferred way to access doubles from different class
Collapse
X
-
What is the preferred way to access doubles from different class
Hi i have my doubles in onbarupdate that i access in my script, however when i get to trail in OnMarketData, it doesnt see those doubles. What is the preffered way to access those doubles from onMarketData?
Thank youTags: None
-
Hello tkaboris,
That would be the correct way to share a variable between two methods. If you want to set the value once you would need your logic to set the value once. You can also set that from OnStateChange if that is supposed to just be a default value or set infrequently. C# has what is known as class level variables, you can research this topic in external resources if you wanted to learn more about how C# variables can be used.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
63 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
35 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
198 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|
||
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
364 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
283 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|

Comment