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 PaulMohn, Today, 05:00 AM
        0 responses
        6 views
        0 likes
        Last Post PaulMohn  
        Started by ZenCortexAuCost, Today, 04:24 AM
        0 responses
        5 views
        0 likes
        Last Post ZenCortexAuCost  
        Started by ZenCortexAuCost, Today, 04:22 AM
        0 responses
        2 views
        0 likes
        Last Post ZenCortexAuCost  
        Started by SantoshXX, Today, 03:09 AM
        0 responses
        16 views
        0 likes
        Last Post SantoshXX  
        Started by DanielTynera, Today, 01:14 AM
        0 responses
        3 views
        0 likes
        Last Post DanielTynera  
        Working...
        X