Thanks!
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
null to variable of type double
Collapse
X
-
null to variable of type double
I'm using Strategy Builder, how can I assign a null value to a variable of type double? Is that possible or is it only possible in NinjaScript Editor? How should I write the code to do that in the NinjaScript Editor?
Thanks!Tags: None
-
Hello daying35,
Thanks for your post.
In the Strategy Builder could consider assigning a value of 0 to your double variable in the Actions section of the Conditions and Actions screen. Otherwise, there are no Strategy Builder options for specifically setting a variable value to 'null'.
Note that double variables and int variables are considered non-nullable value types and cannot be set to 'null' specifically. If you were to try to assign a 'null' to a double variable, such as myDouble = null;, you would a compile error similar to the one below.
Error: 'Cannot convert null to 'double' because it is a non-nullable value type.'
Please let me know if I may assist further.<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
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