Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exporting from 23 - Stochastics Error

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

    Exporting from 23 - Stochastics Error

    Trying to export an indicator as an assembly that uses the Stochastics unit. I'm getting the following error in the log when I try to export, but when I compile my unit, there are no errors.

    Error compiling export assembly: c:\users\john\documents\NinjaTrader 7\bin\Custom\indicator\@Stochastics.cs(61,29): error CS1061: 'double' does not contain a definition for 'Compare' and no extension method 'Compare' accepting a first argument of type 'double' could be found (are you missing a using directive or an assembly directive).

    There is also an error on line (60,29).

    I also found this link with new files for Stochastics, but after following these instructions, it still didn't work:




    Since I can't change the @Stochastics routine, I assume something on your end?

    Thanks
    John
    Last edited by bobcat70; 11-07-2010, 02:14 PM.

    #2
    agreed

    This is certainly true. Here is some more info from a colleague, Vladimir..
    .

    I've found the source code of the Compare method. It is NT's method, not .NET's method.

    It is in this file on my machine:
    C:\Users\Vladimír\Documents\NinjaTrader 7\bin\Custom\Type\@BarsTypes.cs

    The file cannot be added in the Export NinjaScript Archive File dialog.

    Here is the beginning of the file, including the Compare method:
    =================================
    //
    // Copyright (C) 2006, NinjaTrader LLC <[email protected]>.
    //
    #region Using declarations
    using System;
    using System.ComponentModel;
    #endregion

    // This namespace holds all bars types. Do not change it.
    namespace NinjaTrader.Data
    {
    public static class Extensions
    {
    /// <summary>
    /// </summary>
    /// <param name="x"></param>
    /// <param name="y"></param>
    /// <param name="precision"></param>
    /// <returns></returns>
    public static int Compare(this double x, double y, double precision)
    {
    double diff = x - y;
    return diff < -precision ? -1 : (diff > precision ? 1 : 0);
    }
    }
    =================================
    I compared @Stochastics.cs file from beta 22 and RC1 and they differ. The lines in Stochastics that cause the export error are new in RC1.

    Cheers,
    Vlad

    Comment


      #3
      bobcat, saltminer, thank you for reporting. I was able to reproduce and I'll send a note along to development.
      AustinNinjaTrader Customer Service

      Comment


        #4
        If you have an interim fix, please let me know. I need to get something out for production. Thanks.

        Comment


          #5
          Hello bobcat70,

          Unfortunately there is not an interim fix beyond creating your own stochastics.

          You can save a copy of the system stochastics by right clicking > Save As within the NinjaScript editor.

          Make any modifications in this new indicator.

          In your indicator that references stochastics, you would have to update any references to the new indicator you just made.
          Ryan M.NinjaTrader Customer Service

          Comment


            #6
            Thanks for reporting that issue.
            We had been able to isolate the cause of trouble and will provide fix with the next update of NT7.
            Last edited by NinjaTrader_Art; 11-09-2010, 07:44 AM.
            ArtSenior Software Developer

            Comment


              #7
              Had the same problem today. Fixed it my manually copying the indicator file that calls the Stochastics.

              Waiting for the bugfix now.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by fx.practic, 10-15-2013, 12:53 AM
              5 responses
              5,403 views
              0 likes
              Last Post Bidder
              by Bidder
               
              Started by Shai Samuel, 07-02-2022, 02:46 PM
              4 responses
              94 views
              0 likes
              Last Post Bidder
              by Bidder
               
              Started by DJ888, Yesterday, 10:57 PM
              0 responses
              6 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by MacDad, 02-25-2024, 11:48 PM
              7 responses
              158 views
              0 likes
              Last Post loganjarosz123  
              Started by Belfortbucks, Yesterday, 09:29 PM
              0 responses
              8 views
              0 likes
              Last Post Belfortbucks  
              Working...
              X