Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

null to variable of type double

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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!​

    #2
    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>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    163 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    82 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    125 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    206 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    184 views
    0 likes
    Last Post CarlTrading  
    Working...
    X