Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

convert.ToInt32 ? Is this necessary?

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

    convert.ToInt32 ? Is this necessary?

    Using the strategy builder, I created a strategy for entries and exits on a chart that is similar to renko bars. I unlocked the code on a copy of the strategy and I want to edit the entries and exits according to information in the Ninjatrader 8 tutorials. In the script there is "convert.ToInt32" as part of the entry line. Is this necessary? I can't find it in the Ninjatrader tutorials. I'm using Ninjatrader 8 / 64 bit version. Thanks
    Last edited by ronaldgreene828; 01-02-2020, 03:01 PM.

    #2
    Hello ronaldgreene828,

    Thanks for your post.

    Great question! No it is not needed IF the variable is an Integer type or a whole number. The strategy builder by default provides this conversion to prevent any errors if the value provided was a floating point type.

    The Convert.ToInt32() is a C#.Net method to convert the input to a 32 bit integer value. Here is a link to further information: https://docs.microsoft.com/en-us/dot...tframework-4.8
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thanks, it was for default quantity for entries, an integer
      I was trying to fix something by editing the script. Now I figured out what I was doing wrong in the strategy builder. I was focused on using the signal name to label entries and exits on the chart and I wasn't using the same signal name to link entries and exits.
      Last edited by ronaldgreene828; 01-02-2020, 06:06 PM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by hazylizard, Today, 08:38 AM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_Erick  
      Started by geddyisodin, Today, 05:20 AM
      2 responses
      16 views
      0 likes
      Last Post geddyisodin  
      Started by Max238, Today, 01:28 AM
      5 responses
      44 views
      0 likes
      Last Post Max238
      by Max238
       
      Started by giulyko00, Yesterday, 12:03 PM
      3 responses
      13 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by habeebft, Today, 07:27 AM
      1 response
      16 views
      0 likes
      Last Post NinjaTrader_ChristopherS  
      Working...
      X