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

Starting from scratch

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

    Starting from scratch

    Hello,

    I am completely new to NinjaTrader and to NinjaScript, and have been spending some considerable time going through the Help menu. However, I am sufficiently compentent with C# that writing code in NinjaScript should not be much of an issue, once I have learned the necessary methods etc.

    Taking a candle display, what I want to do is to be able to read an array that holds the values displayed on the screen, and process them in the way required. I am working only with the Sim101 account. What I am currently doing is going to the Control Center -> File -> New -> Chart, then select say DOW 30 AA, then display the chart, after having selected Connect -> Kinetick (End of Day) from the Control Center. This then displays a plot for the last year, if I select display by day.

    That is all fine and well, but how do I access with NinjaScript the values shown on the screen? From the Control Center -> Tools -> Edit NinjaScript -> Indicator, then get a long list of abbreviations, starting with ADL, whatever that means. If I click on one of these, then a window opens up with NinjaScript which can be edited, but I have no idea what this means, even if I can understand the code. Also, how do I write text to the output screen? There must be some entry point to do that.

    I would most appreciate some help getting started, as I am completely new to this and do not know how to access the script, even though I am sure that once I get started I should not have much of a problem with the code.

    Many thanks in advance, and perhaps someone could point me to some suitable tutorials.

    Christopher Sharp

    #2
    Hello csharp,

    Thank you for your post and welcome to our forums!

    First, you will need to create an indicator in order to print to the output window. You can create a new indicator by going to Tools--> New NinjaScript--> Indicator.

    The indicators you see listed under Edit are preconfigured Indicator methods that you can use with your indicators:



    Please see our Help Guide article on Developing Indicators for more information:



    We also have a few tutorials on NinjaScript Indicators to help get you started:



    Printing to the output window would require using the Print() function:

    MatthewNinjaTrader Product Management

    Comment


      #3
      Hello Matthew,

      Many thanks for your very quick reply - yesterday I was tied up with other matters and was unable to get back to you until now.

      I looked at the links you sent me, many thanks, and the same help is also available from the NinjaTrader 7 software that I have installed, however, I am still stuck and need some help in getting started.

      This is what I am doing. First I go to Control Center -> File -> Connect -> Kineteck (End of Day), then Tools -> New NinjaScript -> Indicator -> Next, which takes me to a window where I type in a name, such as TestPrint, followed by a description, -> Next, which takes me to a window where I can enter names, types of parameters, default values etc. After clicking Generate, a window with the generated script is opened. I then insert a Print statement inside the method void OnBarUpdate() with something like Print("This is a test message"); with the idea that this message will be printed in the output window, after compiling the code. However, I don't know where I go in order to execute this code, and would most appreciate some guidance on this.

      Once this is solved, which I'm sure is simple, I just don't know the access point to execute the code, the next step will be to write code to read data in the graph generated by historical data, such as AA from Dow 30, then do something with this.

      I would be most grateful for help withy this. I found a few YouTube videos, but so far they do not seem to be very useful.

      Christopher

      Comment


        #4
        Originally posted by csharp View Post
        ... After clicking Generate, a window with the generated script is opened. I then insert a Print statement inside the method void OnBarUpdate() with something like Print("This is a test message"); with the idea that this message will be printed in the output window, after compiling the code. However, I don't know where I go in order to execute this code, and would most appreciate some guidance on this.
        Christopher
        After you finish editing an indicator, you press F5 to compile it into the assembly, and then you use the chart dialog (Ctrl + i) to select and load the indicator on a chart. Use the file menu to open an output window in order to see the output from your "Print" statements.

        Comment


          #5
          OK, many thanks indeed Betrand, I got the script to print in the Output window. So now I hope to be able to make a bit more progess.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by trilliantrader, 04-18-2024, 08:16 AM
          4 responses
          18 views
          0 likes
          Last Post trilliantrader  
          Started by mgco4you, Today, 09:46 PM
          1 response
          10 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by wzgy0920, Today, 09:53 PM
          0 responses
          10 views
          0 likes
          Last Post wzgy0920  
          Started by Rapine Heihei, Today, 08:19 PM
          1 response
          10 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by Rapine Heihei, Today, 08:25 PM
          0 responses
          10 views
          0 likes
          Last Post Rapine Heihei  
          Working...
          X