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

Default parameter specifiers not permitted

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

    Default parameter specifiers not permitted

    Hi, I am adding my methods to UserDefinedMethods (in NS 7, 32 bit).

    My methods do not accept optional parameters as arguments, and throw the above error. My research says need to have .NET 4.0+ which I do. Please help.

    Reproduction (the bold does not work when '= false' is added'):

    public bool myFunction( int BarsBack, bool test = false )
    {
    //some code
    }

    EDIT: Looked at HELP tab, it says
    .NET/CLR Version: 2.0.50727.8669

    Is it running an old version of .NET? If so, can we make it use the latest?

    #2
    Hello,
    NinjaTrader 7 uses the .NET Framework 3.5 as does NinjaScript.
    Methods used in .NET 4.0 and above would not be able to be used in NinjaTrader 7. NinjaTrader 8 does support .NET Framework 4.0.
    Cody B.NinjaTrader Customer Service

    Comment


      #3
      Thank you very much, Cody. Downloaded NT 8, and managed to migrate from NT 7, a large historical database, without any issues. I will check the problem I reported here a bit later, but I am sure it will be ok now.

      Regards, steve

      Comment


        #4
        I figured out a way to do it in NT7 as a workaround. I can use parameter overloading in methods.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by LiamTwine, Today, 08:10 AM
        0 responses
        2 views
        0 likes
        Last Post LiamTwine  
        Started by Balage0922, Today, 07:38 AM
        0 responses
        5 views
        0 likes
        Last Post Balage0922  
        Started by JoMoon2024, Today, 06:56 AM
        0 responses
        6 views
        0 likes
        Last Post JoMoon2024  
        Started by Haiasi, 04-25-2024, 06:53 PM
        2 responses
        19 views
        0 likes
        Last Post Massinisa  
        Started by Creamers, Today, 05:32 AM
        0 responses
        6 views
        0 likes
        Last Post Creamers  
        Working...
        X