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 NullPointStrategies, Today, 05:17 AM
|
0 responses
44 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
124 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
65 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
42 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
46 views
0 likes
|
Last Post
|

Comment