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 Mindset, 04-21-2026, 06:46 AM
|
0 responses
93 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
138 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
68 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
123 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
73 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|

Comment