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

Looking for a tutorial on how to manipulate indicators to create a new indicator

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

    Looking for a tutorial on how to manipulate indicators to create a new indicator

    Hello.

    I am wanting to take indicators that are already installed and working on ninja, to create my own.

    Based on these indicators, I would like to draw various arrows on the chart based on both the vertical position of a few oscillators, as well as their color (histograms and oscillators that change based on slope).

    Is there a tutorial somewhere that goes over how to take any indicator that has already been defined, and how to find the names of the values I would be looking to change, along with how to place them in the indicator file?

    #2
    forrestang, there would be really a specific example for the topic you raised unfortunately, however for modifying / creating indicators in our NinjaScript I would recommend stepping through those here as they cover many aspects - http://www.ninjatrader.com/support/h.../tutorials.htm

    You can then simply open an existing file, right click in it and select 'Save as' to save on a new name for customizing it. If you press F1 in the editor the helpguide and NinjaScript language reference would there for syntax help.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      forrestang, there would be really a specific example for the topic you raised unfortunately, however for modifying / creating indicators in our NinjaScript I would recommend stepping through those here as they cover many aspects - http://www.ninjatrader.com/support/h.../tutorials.htm

      You can then simply open an existing file, right click in it and select 'Save as' to save on a new name for customizing it. If you press F1 in the editor the helpguide and NinjaScript language reference would there for syntax help.
      Can you think of any place that explains how to take an indicator, and FIND the values you are wanting to manipulate?

      To start with I have three oscillators created by someone else. I have 4 ranges or thresholds like in the tutorial, on each of the oscilators:
      < -10
      -10 to 0
      0 to +10
      >10

      I would like to plot on the chart based on the locations of each oscilator based on which region it is currently in.

      How do I go about finding the information that would say for example, "if osc1 is in region A, and Osc2 is in region B and Osc3 is in region C, then do this?

      Comment


        #4
        You would first of all need to call the indicator methods in your code, for example to call the current RSI value you could use RSI(Close, 14, 3)[0], the same would apply to other indicators you would want to call, like the custom scripts you mentioned, Intellisense would help you with overload to use for the call.



        Your region would likely be a threshold level represented by a double # such as

        if (RSI(Close, 14, 3)[0] > 30.0) ....
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Ok, that gets me on the right track!

          In the example you posted, what is the "3" representation of?

          Comment


            #6
            That would be the smoothing paramter of the RSI - http://www.ninjatrader.com/support/h..._index_rsi.htm
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Ok, thanks to you Bertrand, I have managed to figure out how to manipulate my indicator based on the vertical positions of the oscillators that I am using, and have been able to plot various things on the chart based on the vertical position. I.e. >10 etc.

              The next thing I need to figure out is how to get access to the COLORS of those oscillators.

              How would I got about saying, "If color of histogram is equal to the Up Color, THEN....." ?

              Here is an example of the values shown in the data box and the study itself.
              Attached Files

              Comment


                #8
                Hi forrestang,

                Unfortunately there are not available NinjaScript properties for reading the colors of plots. The PlotColors[][] property in NinjaScript is for assignment only.

                In order to expose this, you have to be able to look at the source code, and identify the conditions that cause it to use certain colors.
                Ryan M.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_RyanM View Post
                  Hi forrestang,

                  Unfortunately there are not available NinjaScript properties for reading the colors of plots. The PlotColors[][] property in NinjaScript is for assignment only.

                  In order to expose this, you have to be able to look at the source code, and identify the conditions that cause it to use certain colors.
                  Ok thanks.

                  Comment


                    #10
                    I am getting a compiling error, even with the original 3rd party indicators I am using that is working.

                    The error I get is:
                    "That type of namespace name 'List' could not be found (are you missing a using directive or an assembly reference?)" - CS0246

                    There is a library missing. I've tried to right-click and add the "NinjaTrader.vender," it adds fine but I still get the compiling error.

                    Is there a writeup on how to resolve this somewhere?

                    I'll try this, althogh I think this thread was based on an older version of NT7, but I'll try it anyway:
                    Last edited by forrestang; 05-28-2011, 09:01 AM.

                    Comment


                      #11
                      Originally posted by forrestang View Post
                      I am getting a compiling error, even with the original 3rd party indicators I am using that is working.

                      The error I get is:
                      "That type of namespace name 'List' could not be found (are you missing a using directive or an assembly reference?)" - CS0246

                      There is a library missing. I've tried to right-click and add the "NinjaTrader.vender," it adds fine but I still get the compiling error.

                      Is there a writeup on how to resolve this somewhere?

                      I'll try this, althogh I think this thread was based on an older version of NT7, but I'll try it anyway:
                      http://www.ninjatrader.com/support/f...ad.php?t=22793
                      I tried the above, but I still get that same CS0246 error.

                      -Went to Remove NinjaScript Assemblies, was told I need to remove the files that woudln't compile. I did that.
                      -Removed the file that would not compile, went back to Remove NinjaScript Assemblies, there was nothing there.
                      -Uninstalled NT7 via control panel
                      -Moved "NinjaTrader 7" to new location
                      -Deleted NInjaTrader 7 folder from Program Files
                      -Reinstalled Ninja
                      -Copied back over my non-compiling program
                      -Attempted to recompile - same error
                      -Attempted to right-click and add reference, still same problem.

                      Comment


                        #12
                        forrestang, you likely miss an assembly reference - how to add / readd them would be shown here :



                        It would also if I could take a look at a screenshot of the compile errors you see - could you perhaps attach it here or email me at support at ninjatrader dot com?

                        Thanks,
                        BertrandNinjaTrader Customer Service

                        Comment


                          #13
                          Originally posted by NinjaTrader_Bertrand View Post
                          forrestang, you likely miss an assembly reference - how to add / readd them would be shown here :



                          It would also if I could take a look at a screenshot of the compile errors you see - could you perhaps attach it here or email me at support at ninjatrader dot com?

                          Thanks,
                          Yes sir, I've tried to reattach in the way shown by that link before. It did not work. Here is the error I get.
                          Attached Files

                          Comment


                            #14
                            This would be a separate issue and not linked to the Vendor.Dll missing, to use list you would need to have a using directive for System.Collections in your code in the top section...did you create this indicator?
                            BertrandNinjaTrader Customer Service

                            Comment


                              #15
                              Originally posted by NinjaTrader_Bertrand View Post
                              This would be a separate issue and not linked to the Vendor.Dll missing, to use list you would need to have a using directive for System.Collections in your code in the top section...did you create this indicator?
                              Eeek. Thank you sir I got it! By adding the proper directive @ the top.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by cls71, Today, 04:45 AM
                              0 responses
                              1 view
                              0 likes
                              Last Post cls71
                              by cls71
                               
                              Started by mjairg, 07-20-2023, 11:57 PM
                              3 responses
                              213 views
                              1 like
                              Last Post PaulMohn  
                              Started by TheWhiteDragon, 01-21-2019, 12:44 PM
                              4 responses
                              544 views
                              0 likes
                              Last Post PaulMohn  
                              Started by GLFX005, Today, 03:23 AM
                              0 responses
                              3 views
                              0 likes
                              Last Post GLFX005
                              by GLFX005
                               
                              Started by XXtrader, Yesterday, 11:30 PM
                              2 responses
                              12 views
                              0 likes
                              Last Post XXtrader  
                              Working...
                              X