• 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

What do I need to learn programming NinjaScript?

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

    What do I need to learn programming NinjaScript?

    Hi,

    I will need a NinjaTrader platform to run and test my programs, right? Will I need to pay for the platform, or will a free version be enough for coders?

    Also, can you suggest a good resource of NinjaScript educations for beginning coders?

    Thank you very much.

    #2
    Welcome to our forums tracoder - correct you would need a copy of the NinjaTrader platform installed first, this would be free to use for you completely in simulation mode - meaning only if you want to execute trades to a live account you would need a license from us.

    You can start the download process directly from here - http://www.ninjatrader.com/download-registration.php

    For getting started I would highly recommend those tutorials - http://www.ninjatrader.com/support/h.../tutorials.htm

    Further there's a host of info contained in our reference samples and tips here on the forums -

    http://www.ninjatrader.com/support/f...splay.php?f=29

    In addition there are many scripts already shared freely here, which you could review and futher modify - http://www.ninjatrader.com/support/f...splay.php?f=37
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thank you for your kind help, Bertnard. The educational links you provide are superb, I find it very easy to learn NinjaScript there (also because I used to be very good at Pascal, Java, C, C++).

      For the platform, in my case the free version is enough, because I will not trade live. I have just installed NinjaTrader, but it seems a little bit difficult to connect:
      - I opened a FXCM UK demo to connect, but Ninja said that the broker supported hedging, which was not allowed.
      - Then I opened a FXCM US demo (which does not allow hedging), but Ninja said that "Login failed: Failed to initialize FXCM API".

      Could you give me a hint?

      Thank you.

      Comment


        #4
        You're welcome tracoder, correct would need to be a demo without hedging. Can you please get in touch with us via the Help >> Mail to Support option? This will give us a chance to review the diagnostic trace and logs form the platform for your login issue and further advise on next steps to take. Thanks.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Hi, Bertnard

          I want to let you know that I have successfully connected to FXCM. I just follow your plan: uninstall, then reinstall.

          Your kind support may be the most wonderful in the world.

          Thank you.

          Comment


            #6
            Glad to hear it was resolved and you could continue your work on our platform. Thanks for the kinds words as well, we appreciate it!
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Hi, Bertnard

              I am going to develop an indicator that requires the index of a hovered bar on a chart. Can you let me know some idea?

              Thanks.

              Comment


                #8
                tracoder, there would be unfortunately no supported NinjaScript functions available for this task, however a similar request was discussed in the community here, tapping into the undocumented / C# areas 'under the hood' :

                http://www.ninjatrader.com/support/f...ad.php?t=24766

                All the best.
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  Dear Bertrand,

                  One person in the topic you introduced seemed to already solve the problem. I will learn his programming.

                  Thanks.

                  Comment


                    #10
                    Hi Bertrand

                    How can I make the values of the left and right y-axes exactly equal one-by-one?

                    I want to plot a MAX(High, 10) plot that is overlaid with the primary chart. However, the left and right values (y-axes) are always different, so it's difficult to figure out the meaning of the MAX(High, 10) function.

                    Thanks.

                    P.S. Why do the plot of SMA, MAX, MIN... always start from the 21st bar on, no matter what the period is?
                    Last edited by tracoder; 09-17-2013, 06:33 PM.

                    Comment


                      #11
                      tracoder, that would depend on the ScaleJustification set for the indicator - with prices on the right you want it to be 'right' for the study as well to exactly match - http://www.ninjatrader.com/support/h...lightsub=Scale

                      Any indicator will not be plotted for the first 20 bars of the chart, it's called the unstable period (values catching up / initializing) - you can override this by spec'ing BarsRequired = 0 in your Initialize() method for the study.
                      BertrandNinjaTrader Customer Service

                      Comment


                        #12
                        Thank you. I just add

                        ScaleJustification = ScaleJustification.Right;
                        to the Initialize() and the issue has been solved.

                        Thank you very much.

                        Comment


                          #13
                          Bertrand,

                          What is the definition of a "session" that is referred to in the NT7 guide?

                          Thank you.

                          Definition
                          Gets a value indicating if the bar is the first bar of a session.

                          Property Value
                          This property returns true if the bar is the first bar of a session; otherwise, false.

                          Syntax
                          Bars.FirstBarOfSession

                          Comment


                            #14
                            tracoder, the session will define what hours are used on the charts / series to build your bars. You can use / change to any of the preexisting templates, or create your own in the Session Manager :

                            http://www.ninjatrader.com/support/h...on_manager.htm
                            BertrandNinjaTrader Customer Service

                            Comment


                              #15
                              Thank you Bertrand.

                              For the previous problem of finding the index of hovered bars, I use ChartControl.ChartPanel.MouseMove and another event handler to display X & Y coordinates of my mouse cursor. Even though the coordinates are derived accurately, the coordinate display is always lagging behind my mouse motion by 1-3 seconds. I know this is out of your support scope, but with your great experiences can you let me know what I am doing wrong, or what I can do to improve the speed, or C# is always lagging like this?

                              Thanks in advance.

                              Here is my simple code:
                              protected override void Initialize() {
                              Overlay = true;
                              }

                              private void myMouseEvents(object sender, MouseEventArgs e) {
                              DrawTextFixed("info", "X = " + e.X + "\nY= " + e.Y, TextPosition.BottomRight, Color.Red, new Font("Courier", 20), Color.Black, Color.Yellow, 10);
                              }

                              protected override void OnBarUpdate() {
                              ChartControl.ChartPanel.MouseMove += new MouseEventHandler(myMouseEvents);
                              }
                              Last edited by tracoder; 09-19-2013, 06:23 AM.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by rouillard, Today, 03:34 PM
                              2 responses
                              18 views
                              0 likes
                              Last Post rouillard  
                              Started by mquinteroj, Today, 02:41 PM
                              1 response
                              10 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by JPPoulin, Today, 01:32 PM
                              4 responses
                              15 views
                              0 likes
                              Last Post JPPoulin  
                              Started by bltdavid, Today, 01:09 PM
                              1 response
                              10 views
                              0 likes
                              Last Post NinjaTrader_Kate  
                              Started by pstrusi, Today, 12:50 PM
                              2 responses
                              8 views
                              0 likes
                              Last Post pstrusi
                              by pstrusi
                               
                              Working...
                              X