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

Remove an Input Question

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

    #16
    VT,

    Hate to keep bugging you with problems. Reinstalled NT and the tried to compile the indicator again. Still getting an error mesage because of what I've done. (see attachment) If you've got any ideas I'll be happy to hear them. Not a problem though. I'll just delete NT and start with a new installation of NT. I've got backups of backups. (Already learned that lesson!)

    Thanks,

    Rod
    Attached Files

    Comment


      #17
      Rod,

      It looks like you were trying to compile BarNumberBelowBar, but you also have a file called BarNumberBelowBarCopy. Both of these files have definitions for checkBarNumberBelowBar and whatever the top one is. Point is though, they are duplicates. I would guess that the copy was not made using "Save As".

      What I would do is remove the BarNumberBelowBarCopy.cs file from the indicator directory (you can save it in a separate folder if you wish), and then try re-compiling. If successful and you want to have a copy in the indicator folder. Right click in the editor with the BarNumberBelowBar open and choose "Save As", then you could save a copy as BarNumberBelowBarCopy, and the compiler won't get confused.

      Hope this helps.

      VT

      Comment


        #18
        VT,

        I reinstalled NT, imported the indicator without a problem and then copied the templates and one workspace I had been using into the respective directories in the new installation. The workspace opened correctly and templates were as I expected. I then tried to open the indicator I've been having problems with and make the changes as you explained. The indicator doesn't show in the list of indicators to edit but it is availble in the list of indicators to apply to a chart. The .cs file is in the bin/custom file as opposed to the bin/custom/indicator file. I opened the file and it's missing parts though I don't know how it was imported. I can compile without errors now. Did my transfer of the templates and workspace have unintended consequences?

        Thanks,

        rod
        Last edited by ramckay; 03-14-2012, 01:18 AM.

        Comment


          #19
          Rod,

          If it's compiling and plotting/working as expected, then you should be fine. The fact that you can see it in the list of indicators to apply to a chart, but not in the list of indicators to edit, is because it was exported as an assembly, and cannot be edited. The .cs file that is in the "Custom" folder is generated when the source code was exported as an assembly...it is not the source code and should not be edited. It basically is the NinjaScript generated (constructors etc), that I mentioned previously and appears at the bottom of a normal NinjaScript source code .cs file.

          VT

          Comment


            #20
            Hi VT,

            Is there a way to export an indicator so that it is not an assembly so that I have the option to revise it? I didn't know there was a difference I've encoutered this before.

            Thanks,

            Rod

            Comment


              #21
              Hi Rod,
              Yes, you can export as "source", which is an available selection when using File > Utilities > Export NinjaScript. For more information see top section in this link:
              Ryan M.NinjaTrader Customer Service

              Comment


                #22
                Hi VT and Adam,

                You guys are geniuses. I followed your directions and everything works now as advertised. Thanks for all the help. One last question. VT you said
                When the work is done in Visual Studio, I save it in VS and then compile any other file (except the one I was modifying) in the NT editor. This process allows NinjaScript to generate all the code the correct way.
                When you save the file from VS do you save it in the bin/Custom/Indicator folder, then open it with the NT editor, and then compile the file?

                Thanks,

                Rod

                Comment


                  #23
                  Hi Rod,

                  Glad you've got it working.

                  The NT compiler compiles all the strategy/indicator files to make the NinjaTrader.Custom.dll file, which is what NT uses at runtime. It also produces a temporary version of that file that it will use instead whenever a re-compile is done during a session, that way NT can access the changes without having to restart.

                  What I meant in the previous post was. I have a file in the Indicator directory that has nothing but an empty class in it, that I keep open in the NT editor all the time when coding, I use it just for compiling. Keep in mind, compiling any indicator or strategy file is compiling ALL the NinjaScript files into the NinjaTrader.Custom.dll file or the temporary version of it. In VS I'm actually opening/editing/saving an indicator or strategy file in the Indicator or Strategy directories, they are the actual files that would be opened/edited in the NT editor. After I make the changes in VS, I just save it and hit f5, in the "Compile file" I always keep open in the NT editor and let the NinjaScript compiler work it's magic. The changes can then be reflected just by reloading NinjaScript (f5) in a chart. The file that you compile does not have to be the file you edited, in fact, it's better if it's not. Hence, the "Compile file".

                  As I mentioned previously. If I want to make a copy/rename a file, I open the file I want to rename in NT editor and right-click->"Save As", give it a new name and compile it. I DO NOT use VS for this intitial process, let the NT editor/compiler do the renaming and generating the code it needs. After that, I will open in VS and edit as described above.

                  The setup is a little bit more complicated than I described here, but that is a different story.

                  Hope that makes sense.

                  VT
                  Last edited by VTtrader; 03-14-2012, 07:47 PM.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by jaybedreamin, Today, 05:56 PM
                  0 responses
                  2 views
                  0 likes
                  Last Post jaybedreamin  
                  Started by DJ888, 04-16-2024, 06:09 PM
                  6 responses
                  18 views
                  0 likes
                  Last Post DJ888
                  by DJ888
                   
                  Started by Jon17, Today, 04:33 PM
                  0 responses
                  1 view
                  0 likes
                  Last Post Jon17
                  by Jon17
                   
                  Started by Javierw.ok, Today, 04:12 PM
                  0 responses
                  6 views
                  0 likes
                  Last Post Javierw.ok  
                  Started by timmbbo, Today, 08:59 AM
                  2 responses
                  10 views
                  0 likes
                  Last Post bltdavid  
                  Working...
                  X