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

How to compile CS files

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

    How to compile CS files

    When somebody shares their ninjascript file how do I compile that as an indicator? I have a file with some code which I have copied to the ninjascript editor and managed to compile without any errors. The problem is that it does not show up in my list of indicators on any of my charts. It does show up in the ninjascript explorer though (under indicators).

    #2
    Hello Grantx,

    Thanks for your post.

    We recommend using our import/export process to distribute NinjaScripts to be sure that all dependencies are included, to avoid confusion, and to prevent situations where the NinjaTrader Documents folder gets damaged.

    Import - https://ninjatrader.com/support/help...nt8/import.htm

    Export - https://ninjatrader.com/support/help...nt8/export.htm

    NinjaScripts will have three different names.

    1. The Filename, which will be seen in the NinjaScript Editor
    2. The Class name, which makes the script unique on your platform
    3. The Name property, which is set in OnStateChange under State.SetDefaults. This name will be seen in the Indicators dialog.

    If you do not see the indicator's name (Name property) in the Indicators dialog, I suggest checking the Log tab of the Control Center for any errors involving the indicator. If the indicator hits a run time error before it is listed, it will not be listed.

    We look forward to assisting.
    JimNinjaTrader Customer Service

    Comment


      #3
      the file has a .CS extension and I have copied the text into a new indicator file. I go to the ninjascript editor and select new indicator.
      Then I copy the entire contents into the new script and compile with no errors.
      I name the file. I can see the file in ninjascript but not from the chart.
      I deliberately create an error and the compilation tells me there is an error. When I remove the error it compiles just fine. Where is it compiling to? Am I missing a step?

      Comment


        #4
        Hello Grantx,

        All NinjaScripts in source code are compiled into the Documents\NinjaTrader 8\bin\Custom\NinjaTrader.Custom.dll file. You are not missing a step and just need to know what the name is that you should be looking for.

        If the script compiles, check for the Name as entered for the Name property under OnStateChange > State.SetDefaults. This will be the name listed in the Indicators dialog. Check any subfolders in the Indicators dialog as well.

        If you do not see the indicator listed, please check the log tab of the Control Center for runtime errors and inform the developer.

        If you are stuck here, I may suggest reaching out to the developer of the indicator so they can give you an export of the indicator and let you know what name you should be looking for. You can then import it following the steps linked in post #2.

        If you want to learn more about NinjaScript code, I recommend starting with the Strategy Builder 301 course and NinjaScript Editor 401 course.

        Strategy Builder 301 — https://www.youtube.com/watch?v=HCyt90GAs9k

        NinjaScript Editor 401 — https://www.youtube.com/watch?v=K8v_2ONBbqI

        We look forward to assisting.
        JimNinjaTrader Customer Service

        Comment


          #5
          Found it. Thank you very much indeed Jim.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by SydniBuck, Today, 12:54 AM
          0 responses
          4 views
          0 likes
          Last Post SydniBuck  
          Started by ketostrongbuyno, Yesterday, 11:50 PM
          0 responses
          6 views
          0 likes
          Last Post ketostrongbuyno  
          Started by ReinaKutch, Yesterday, 11:08 PM
          0 responses
          7 views
          0 likes
          Last Post ReinaKutch  
          Started by JackyThur, Yesterday, 10:51 PM
          0 responses
          9 views
          0 likes
          Last Post JackyThur  
          Started by sjeffblack, Yesterday, 01:22 PM
          2 responses
          30 views
          0 likes
          Last Post sjeffblack  
          Working...
          X