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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
43 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
20 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
30 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
48 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
38 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment