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

Cannot Compile after botched Import - Indicator

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

    Cannot Compile after botched Import - Indicator

    Hello NinjaTrader programers,

    My Ninja worked itself into a tangle so let me start from the beginning:

    I started programing my indicator called CompareTickers.
    The indicator compiled but when I added in onto a candlestick chart it
    produced no results. There were no lines in the bottom of the window.

    (I figure that 'it compiled' so it was coherent to the compiler
    but 'my programing logic/code was wrong')

    Then I went to bed.

    The following day I reflected on the problem and decided that perhaps
    someone may have already done something similar, so why debug my code
    and 're-invent the wheel' instead of searching for the indicator on the web.

    OK, I found a KJcorrelation.cs at


    I downloaded it and then searched on the web where to put the file so that
    Ninja can access it. It said in Documents/NinjaTrader7/bin/Custom
    so that's where I put it.

    I then went to import it in Ninja 7 Control Centre:
    File - Utilities - Import NinjaScript

    .... and this is where things start to get just a little weird ...
    It gave me an error message saying it can't compile because other Ninja Script
    Assemblies have compile errors in them and these need to be corrected first.

    So I thought, 'It must be the CompareTickers indicator I was working on the other night', so I went to Edit and Compile this CompareTickers to see what sort of error it supposedly had even though I believed it DID compile on the previous night and only
    produced a null result in the window - which is not the same as not compiling.
    Or so I thought.
    (First I tried: Tools/Edit Ninjascript and Delete CompareTickers, but it wouldn't allow me to do that.)

    Anyway, upon trying to compile the indicator CompareTickers it game me a compile error which said something like 'alglib not present' line 11 pos 7.
    And that's really weird! It's bizarre because CompareTickers had NOTHING to do with the alglib maths library - the maths library was used by KJcorrelation!

    So I thought 'Well the KJcorrelation must have imported, otherwise why would the
    system be looking for "alglib"?' But when I checked, KJcorrelation was not among
    the indicators!!

    Now I realise that in the forum thread above, it had specified a specific
    sequence of events to making KJcorrelation work by firstly downloading and
    copying the alglib math library files into Documents/ninjatrader7/bin/Custom/Indicators BEFORE trying to get the KJcorrelation indicator on board (and not by importing it, but by copying it to ...bin/Custom/Indicators and then Editing it and Compiling it - of all things) and so I haven't followed this special sequence, I do admit this but sheesh, is this complicated or what?
    And of course now, I am in an even more difficult position because
    I have these two indicators that don't compile - neither of them!

    Well at that point I thought I better follow the special sequence of unzipping and
    copying the alglib files to ...bin/Custom/Indicators and hopefuly Ninja will find all the files and both of the indicators will hopefully compile. I also moved the KJcorrelation from ..bin/Custom to ../bin/Custom/Indicator.

    But that didn't help, the error is:
    Indicator\KJCorrelation.cs A using namespace directive can only be applied to namespaces; 'alglib' is a type not a namespace CS0138-click for info L11 Col7

    Then I commented out all (two actually) references to alglib in the KJcorrelation (Line11 pos7 and one other place)
    indicator code (of course there were no references to it in CompareTickers) and tried
    to compile it - the error given differs from previous one but neither file compiles - I am pulling my hair out!!
    Indicator\alglib_info.cs Duplicate 'System.Reflection.AssemblyCompanyAttribute' attribute CS0579-click for info L2 Col11
    Indicator\alglib_info.cs Duplicate 'System.Reflection.AssemblyProductAttribute' attribute CS0579-click for info L3 Col11

    Is there some way to either untangle this mess or just to 'start over' by deleting something and getting a clean slate?

    Many thanks in advance, Mark.

    #2
    Edit any indicator. Then compile via F5.

    You will now see a number of error messages appearing at the bottom of the editor.

    Delete all indicator files that are mentioned in the error messages.

    Compile again via F5.

    Repeat the process until the error messages are gone.

    From now on only install indicators, which have no bugs.

    Comment


      #3
      Hello stoklasy,

      Thank you for your post and welcome to the NinjaTrader Support Forum!

      Please shut down NinjaTrader and navigate back to Documents/NinjaTrader7/bin/Custom where you placed the unzipped files. Then delete those files and start NinjaTrader. Navigate to Toools > Edit NinjaScript > Indicator > select ANY indicator > OK > when it opens right click and select Compile.

      If you receive any errors please attach a screenshot of those errors to your response with the description field clearly readable.

      Comment


        #4
        Hi Guys,

        Thanks for trying to help but Ninja now has a different problem.
        I went to .../Documents/ Ninja Trader 7/bin/Custom/Indicator and deleted the KJcorrelation.cs file. (actually cut and pasted it elsewhere for saving)

        Then I went to start my Ninja.

        But Ninja doesn't even start - it opens a window as if unpacking/installing an application and says:
        Ninja Trader 7
        The feature you are trying to use is on a network resource that is unavailable

        Click OK to try again, or enter an alternate path to a folder containing the installation package 'tmp 13D.tmp' in the box below.

        Use source:
        (has a drop-down box with only a single path to choose:
        C:\DOCUME~`\karen\LOCALS~1\Temp\

        And because I don't have any idea where to look for this file I click Cancel and get:

        An installation package for the product Ninja Trader 7 cannot be found. Try the installation again using a valid copy of the installation package `tmp13D.tmp`
        (OK button)

        Problem with shortcut
        Fatal error during installation
        (OK button)

        I then replaced the KJcorrelation.cs file back but the problem is the same.
        --------------------------------------------------------------------------------
        I just remembered that Norton suggested
        Tune Up
        and I ran File Clean-up
        and that did seem to be deleting some temporary files ...
        I and now thinking that this has caused this latest problem.
        -----------------
        This Ninja is authorised for Live Trading and I suppose I can re-install if necessary but would I loose the existing indicators and strategies that I have there?

        [Note I tried WinUndelete to see if I could recover the tmp 13D.tmp file but no matter what settings I used the file undeleter didn't find it. I guess I just did too much web browsing and other stuff so the file got overwritten. :-( Oh well... ]

        What now?

        And thanks again guys.
        Mark

        Comment


          #5
          Hello,
          Thank you for your post stoklasy.
          I would like to schedule a support call with you today. Please send a note to platformsupport[AT]ninjatrader[DOT]com with the following information.

          The following link http://www.ninjatrader.com/support/f...ad.php?t=71619
          A phone number where you can be reached
          A time window where I can call you (please include a time zone)
          Shortly before our call please launch our remote support application from the following link, http://www.ninjatrader.com/rs. Once launched, the application will provide you with an ID# and password. I will need these from you once I have you on the phone. Keep the program running for me to connect.
          I look forward to our support call.
          Cody B.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by RubenCazorla, Today, 09:07 AM
          2 responses
          11 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by i019945nj, 12-14-2023, 06:41 AM
          7 responses
          81 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by timmbbo, 07-05-2023, 10:21 PM
          4 responses
          158 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by tkaboris, Today, 08:01 AM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by Lumbeezl, 01-11-2022, 06:50 PM
          31 responses
          819 views
          1 like
          Last Post NinjaTrader_Adrian  
          Working...
          X