Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

programming of very basic indicators

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

    programming of very basic indicators

    Besides the PDF and the Reference Samples at the forum,
    there are no other examples, correct?

    #2
    Hello,

    No, there are lots of examples on this forum. I would start with the reference samples.
    DenNinjaTrader Customer Service

    Comment


      #3
      Ok, is it reasonable to search for an example that
      will draw and up arrow when a TRIX(50,5) crosses?
      I will give it a shot if you think I can find something
      within 20 minutes. Else it seems like searching for a
      needle in a haystack. I'm not looking for a program
      that will do 100 things including the above. It's hard
      enough already.

      Comment


        #4
        Ok, finally I seem to be getting there. But I still think
        that a hundred or so very basic ninjascript examples
        for indicators would be a good idea. Telling people to
        have a programmer do it means, essentially, that the
        cost of NT software has a number of hidden fees. Each
        indicator being that $XXX fee.

        Comment


          #5
          Hello,

          Yes, to use any programming language you will need to have some programming knowledge. Due to resource limitations the more complex or common confusion areas have examples in the reference samples area. I will pass your suggestion on to our development department for consideration though. Thank you!
          DenNinjaTrader Customer Service

          Comment


            #6
            programming indicators

            i too am looking for a basic indicator.

            when CCI crosses over -100(user input) draw an up arrow on the low of the previous bar and play a sound.

            am able to do it in strategy but that takes my trades off the chart and they have to be reloaded each time i connect.

            any suggestions on where to start or to give the code.

            i can use the swing indicator as a starting point.

            just dont see how to do a crossover like in the strategy

            Comment


              #7
              figured out i can view the code from the strategy. now the question is can i copy pieces of that code or convert a strategy into an indicator

              Comment


                #8
                The best way to learn in the beginning is to view NinjaScript that you understand.

                For instance, Tools -> Edit -> Indicator, and pick one you grasp the end result of, like SMA. Open it, don't change anything, and read it one line at a time.

                C# is not some alien language. It is pretty straight forward english, to read and understand. The harder part is when you want to do something and you don't know the command and haven't found an example. Then you can google it and find it usually pretty instantly.

                As for NT-specific functions, you'll find a hundred examples in the File Sharing section, plus the ones already included with the shipping version of NT.

                If you want to know how to paint an arrow on the screen when a Cross happens, then you could for instance browse through the list of indicators in File Sharing section, look at the pictures, and find one that paints arrows on the screen. Then look at the code.

                If all of this is too overwhelming, hire a programmer in the beginning and tell him up front to comment all the code so you can read it and learn from it later. You tell him in plain english what you want, you pay him for his expertise, and then you learn from the result.

                Mike

                Comment


                  #9
                  trader1512,

                  If you already have the working code in a Strategy, that code will most likely be very easy to put into an indicator instead.

                  I would suggest opening up the CCI indicator, then Save As and name the new one "CCI Mod" or "My CCI" or whatever so you only mess with a copy, leaving the original alone. In this case, CCI is built-in to Ninja, so you have to save a new copy to make changes regardless.

                  Then you'll see at the bottom of the page where it is setting the value (Value.Set). Underneath that is probably a good spot to put your code, which presumably is a if (CrossAbove()) and DrawUpArrow and PlaySound. It should all work fine.

                  If you still have problems, paste all relevant code to the forum and the errors, if any, so others can easily help you.

                  Mike

                  Comment


                    #10
                    thanks. can someone point me to the file sharing and pdf sections that is referenced on the forum. i have had no luck finding them.

                    Comment


                      #11
                      You can check the reference samples here - http://www.ninjatrader-support2.com/...splay.php?f=30

                      Our indicator coding tutorials can be found here - http://www.ninjatrader-support.com/H...verview18.html

                      The indicator file sharing section is located here - http://www.ninjatrader-support2.com/...splay.php?f=38

                      Our strategy wizard can also be a great and effective learning tool, as you can later choose to view and unlock the generated source code - http://www.ninjatrader-support.com/H...rdScreens.html
                      BertrandNinjaTrader Customer Service

                      Comment


                        #12
                        that is what i have been doing with the strategy wizard, the question is whether i can convert the strategy code into an indicator.

                        Comment


                          #13
                          Originally posted by trader1512 View Post
                          that is what i have been doing with the strategy wizard, the question is whether i can convert the strategy code into an indicator.
                          Hi trader1512,

                          If you have limited time or programming capabilities, you can discuss your requirements with any of our NinjaScript consultants.
                          Click here for a list of certified NinjaScript Consultants
                          Ray S.NinjaTrader Customer Service

                          Comment


                            #14
                            can you direct me on how to remove something from the namespace. when i compile i am getting an already exists message.

                            thansk

                            Comment


                              #15
                              trader1512,

                              Unfortunately we do not know which scripts may be conflicting with what in your install. It may be easiest if you cleared your NinjaScripts out to remove any potential conflicts.
                              Josh P.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by RubenCazorla, Today, 09:07 AM
                              1 response
                              5 views
                              0 likes
                              Last Post RubenCazorla  
                              Started by Irukandji, Today, 09:34 AM
                              0 responses
                              3 views
                              0 likes
                              Last Post Irukandji  
                              Started by TraderBCL, Today, 04:38 AM
                              3 responses
                              25 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Started by WeyldFalcon, 08-07-2020, 06:13 AM
                              11 responses
                              1,423 views
                              0 likes
                              Last Post jculp
                              by jculp
                               
                              Started by BarzTrading, Today, 07:25 AM
                              2 responses
                              29 views
                              1 like
                              Last Post BarzTrading  
                              Working...
                              X