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

Failed strategy compilation

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

    Failed strategy compilation

    I am using custom PriceActionSwingOscillator indicator (enclosed) to create a strategy using Strategy Builder.
    I am getting failed to compile messages. When unlocking code I see the message that this indicator is method.
    Is there any way to overcome that ?
    Strategy is quite simple: GO LONG when RTUptrend equal 1. And EXIT when RTDowntrend equal 1 ( see attachments)
    Thanks
    Attached Files

    #2
    Hello kazbek966,

    Thank you for your post.

    I have moved this from the Technical Support section of the forum to the Strategy Development section. So I may accurately assist you, please answer all of the following questions:
    • What version of NinjaTrader are you using? Please provide the entire version number. This can be found under Help -> About (Example: 8.?.?.?)
    • Is the PriceActionSwingOscillator an indicator that you developed or one that was imported from a third party?
    What compile error(s) are you getting?
    • Go to the Control Center > New > NinjaScript Editor
    • Right-click in the NinjaScript Editor > select 'Compile'
    You should see some errors in orange appear at the bottom of the window. Expand this window so that as many of these error messages, if not all of them, are visible. Please send us a screenshot of these errors, and we will be able to send you the steps to resolve them.

    A visual walkthrough of this process along with solutions to common compile errors may be found here in our Help Center.

    To send a screenshot with Windows 10 or newer I would recommend using the Windows Snipping Tool - Click here for detailed instructions

    I look forward to your reply.
    Emily C.NinjaTrader Customer Service

    Comment


      #3
      Hi Emily,
      1. 8.0.28.0 64-bit
      2. As seen from enclosed cs file it is third party indicator which I happen to use quite often, and it never been an issue before
      3. Error code is CS0119 on a line 69, columns 72 and 127 I believe ,there is fair long message with Indicator parameters ending with "is a method) which is not

      else if (State == State.DataLoaded)
      {
      StrategyTotallPNL = new Series<double>(this);
      CurrentPNL = new Series<double>(this);
      PriceActionSwingOscillator1 = PriceActionSwingOscillator(Close, PriceActionSwing.Base.SwingStyle.Standard, 3, 8, true, PriceActionSwing.Base.Show.Trend, true, false, false);
      HalfTrend1 = HalfTrend(Close, Convert.ToInt32(PARAM), PARAM, 100, true, true, 10);
      Momentum1 = Momentum(HalfTrend1.DnSignal, 1);
      }​

      I am enclosing txt file with the strategy. Please do not pay much attention to the presence of custom third party half-Trend Indicator as by itself it works just fine.

      Attached Files

      Comment


        #4
        Hello kazbek966,

        Thank you for your reply.

        Since you are getting a CS 0119 error, please reach out to the developer of the indicator (their email address seems to appear in a comment at the beginning of the script). In some other forum threads, users have gotten CS 0119 errors when trying to use a particular indicator in their strategy, and the resolution was to add a specific using statement to the top of the strategy script. The developer of the indicator should be able to confirm with you if a using statement is needed, and if so what using statement you should use.

        As a side note, adding a using statement would require you to work with the strategy unlocked in the NinjaScript Editor because it is not possible to add a using statement in the Strategy Builder. Ultimately, this particular indicator does not seem to be compatible with the Strategy Builder and any questions about its use in other scripts should be directed to the developer directly.

        Thank you for your time and patience.
        Emily C.NinjaTrader Customer Service

        Comment


          #5
          Thank you, Emily.
          So what are usual " using statements " are ?

          Comment


            #6
            Hello kazbek966,

            Thank you for your reply.

            Using statements are a general C# concept and are not specific to NinjaTrader. You may find out more about them by searching through third-party C# resources, such as the following publicly available link:

            When creating a strategy via the Strategy Builder, the minimum code to work with any supported NinjaScript type is added, including the using statements at the top of the script. Since you are having issues when trying to add a custom indicator to your strategy, you will need to reach out to the developer of the indicator for assistance on how to do so since it does not seem to work with the default using statements that are added. An additional using statement may be needed or you may need to use the fully qualified namespace; either way, something with their indicator is causing the errors so they will need to address it.

            Please let us know if we may be of further assistance.
            Emily C.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by tsantospinto, 04-12-2024, 07:04 PM
            7 responses
            126 views
            0 likes
            Last Post aligator  
            Started by futtrader, 04-21-2024, 01:50 AM
            5 responses
            56 views
            0 likes
            Last Post NinjaTrader_Eduardo  
            Started by PeakTry, Today, 10:49 AM
            0 responses
            2 views
            0 likes
            Last Post PeakTry
            by PeakTry
             
            Started by llanqui, Today, 10:32 AM
            0 responses
            5 views
            0 likes
            Last Post llanqui
            by llanqui
             
            Started by StockTrader88, 03-06-2021, 08:58 AM
            45 responses
            3,994 views
            3 likes
            Last Post johntraderuser2  
            Working...
            X