• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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 darkgreen, Today, 11:53 AM
          0 responses
          4 views
          0 likes
          Last Post darkgreen  
          Started by Lumbeezl, Yesterday, 06:32 PM
          4 responses
          25 views
          0 likes
          Last Post MojoJojo  
          Started by trader510, Today, 11:44 AM
          0 responses
          7 views
          0 likes
          Last Post trader510  
          Started by ozziyhtomit, Yesterday, 05:24 PM
          1 response
          12 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by habibalex, Today, 09:45 AM
          1 response
          10 views
          0 likes
          Last Post NinjaTrader_Tabor  
          Working...
          X