protected override void OnStartUp()
{
string a = "pie";
}
protected override void OnBarUpdate()
{
Print(a);
}
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Access same string in different methods
Collapse
X
-
Access same string in different methods
If I have a situation like this:
It seems that the string "a", which was declared in OnStartUp, produces an error ("The name 'a' does not exist in the current context") when referenced in OnBarUpdate. Is there a way to get around this? Thanks.PHP Code:Tags: None
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
630 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
364 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
566 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
568 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment