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

First Indicator

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

    First Indicator

    Hello I am new to Ninja. I watched some intro videos and familiarized myself with the chart setup but I am having difficulty getting started with the script. If I get some help to do a basic custom indicator I think I'll be able to build on that. My attempts to do this so far have failed-

    How would I make an indicator that plots the difference between two different EMA's - say length 50 and 25 for example

    Thank you


    #2
    Hello Paracelsus462,

    Thanks for your post and welcome to the NinjaTrader forums!

    Below I will provide links to various pages that will provide good references for you.

    If you would like to take on learning NinjaScript, we have a fully documented help guide which will help you get started.

    In the help guide, there are language references to all of the methods and functions you will be using. All links below are publicly available.

    If you are new to C#, to get a basic foundation for the concepts and syntax used in NinjaScript I would recommend this section of articles in our NT7 help guide first:
    https://ninjatrader.com/support/help...g_concepts.htm

    Here is a link to the NT8 Educational Resources section of the Help Guide to help you get started with NinjaScript: https://ninjatrader.com/support/help..._resources.htm

    The best way to begin learning NT8 NinjaScript is to use the Strategy Builder. With the Strategy Builder you can set up conditions and variables and then see the generated code in the NinjaScript Editor by clicking the View Code button. https://ninjatrader.com/support/help...gy_builder.htm

    I'm also providing a link to a pre-recorded video of 'Strategy Builder 301' for you to view at your own convenience.
    Strategy Builder 301 - https://www.youtube.com/watch?v=HCyt...ZmVnauWXkWe0Nf

    When you are ready to work directly in Ninjascript you will be using the Ninjascript editor, here is a link to the Ninjascript 401 editor:
    NinjaScript Editor 401 - https://www.youtube.com/watch?v=BA0W...ZmVnauWXkWe0Nf

    The entire Alphabetical Reference can be found with the following link: https://ninjatrader.com/support/help..._reference.htm

    Below are links to Reference Samples online as well as some Tips and Tricks for both indicators and strategies. These samples can be downloaded, installed and modified from NinjaTrader and hopefully serve as a good base for your custom works.

    Click here to see our NinjaScript Reference Samples:
    https://ninjatrader.com/support/help...ce_samples.htm

    Click here to see our NinjaScript Tips: https://ninjatrader.com/support/help...n-us/?tips.htm

    There is also a growing library of user-submitted custom indicators (100+) that can be downloaded from our support form. Please look in the NinjaScript File Sharing section of our support forum as you may find what you are looking for there: https://ninjatraderecosystem.com/use...r-8-indicators

    Last, I'm also sharing a link to another forum post that reviews how to use prints to understand behavior and debug a script when the behavior is unexpected. https://ninjatrader.com/support/foru...979#post510979

    To get started on your indicator, what I recommend is that you first identify what you want for inputs, for example, do you want to always use the same periods for the EMAs or would you like to change the periods without recoding the strategy? For the output, do you want a line type plot or a bar type plot (histogram), what color, what size, etc. One consideration is that the difference between the EMAs will be a small value compared to the actual price, so if you want to plot this on the price panel then you would need to add an offset of some type, if you want to plot this on an indicator panel then that is not a concern. Once you have identified what the inputs and outputs are you may want to review all of the indicators available and study the closest one(s).
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Always the same EMA periods. Line type. Indicator panel. I have been through a lot of those links and still can't get this working. If someone would provide this one example I think it would help a lot

      Comment


        #4
        Hello Paracelsus462,

        Thanks for your reply.

        Those are a lot of links with a lot of information and over time they will serve you well.

        To further assist I've created a short video on how to create this simple indicator.

        Paul H.NinjaTrader Customer Service

        Comment


          #5
          What exceptional support. Thank you. It appears that my error was trying to define the EMA difference as a data series in 'additional data' during the setup. Apparently that was not needed. All you had to do was make the plot in the setup and then define the plot value as an EMA difference. I have scripted the heck out of thinkscript and mathematica but other than that I have little programming knowledge so I assumed I had to define all my data sets in the setup. Apparently this is all more straightforward than I thought, thank you again
          Last edited by Paracelsus462; 10-23-2018, 10:17 AM.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by helpwanted, Today, 03:06 AM
          0 responses
          2 views
          0 likes
          Last Post helpwanted  
          Started by Brevo, Today, 01:45 AM
          0 responses
          6 views
          0 likes
          Last Post Brevo
          by Brevo
           
          Started by aussugardefender, Today, 01:07 AM
          0 responses
          5 views
          0 likes
          Last Post aussugardefender  
          Started by pvincent, 06-23-2022, 12:53 PM
          14 responses
          242 views
          0 likes
          Last Post Nyman
          by Nyman
           
          Started by TraderG23, 12-08-2023, 07:56 AM
          9 responses
          384 views
          1 like
          Last Post Gavini
          by Gavini
           
          Working...
          X