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

draw horizontal lines at values of an indicator

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

    draw horizontal lines at values of an indicator

    Hello, does anyone know how to build an indicator which draws for any given timeframe (also intraday) configurable horizontal lines at the values of any given indicator calculated for the monthly weekly and daily timeframes?
    For example if on an hourly chart we have 3 EMAs with periods, say 20; 50; 200, the indicator should draw on the chart nine horizontal lines at the values that such 3 EMAs would have when calculated for the daily, weekly and monthly timeframes. (…. ideally picking up the same format - line type, color, thickness – of the indicator)
    If such indicator already exists, could you please provide some directions on where to find it?
    Thanks. GT

    #2
    Hello guidoisot,

    Thank you for your note.

    I am unaware of an indicator which does this however I would suggest checking out the Indicator section of our forum.



    To code this you would need to add a secondary data series of day/month, for which you’d pass to the EMA then set to the value of the plot. Please see MultiTime Frame section of our helpguide.



    I have put together a sample indicator which has two plots, 1 being set to the 5 period EMA of a daily data series and 1 to the 5 period EMA of the monthly data series.

    Please let us know if you need further assistance.
    Attached Files
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Thank you Alan
      it looks like your sample indicator does not compile in NT8 (is it perhaps for ver.7 ?) I have tried to build it for ninjatrader 8, but I was not able to do it.
      I attach an image of what I have done.
      However before reading your email I noticed that there is a partially similar ninjatrader8 default indicator called "constant lines", maybe it is possible to derive what I am looking for from it.
      Another possible candidate to generate the indicator perhaps could be this one:



      Regards. GT
      Attached Files

      Comment


        #4
        Hello guidoisot,

        The indicator I provided was written in NT7, which is the version of NinjaTrader this forum post is in.

        I have converted it to NT8 for you and attached it.

        I’m not sure you would need the sample you linked to for what you’re looking to do, however the attached script will get you started.

        If you would like to take on learning NinjaScript, we have a fully documented help guide which will help you get started with Ninja Script. You will find language references to all of the methods and functions you will be using. You will also see a tutorial section which will help you create your first indicator and get you started with some of these concepts.

        A link to our Help Guide with tutorials can be found below:


        The entire Alphabetical Reference can be found with the following link:


        The best way to begin learning NinjaScript is to use the Strategy Wizard. With the Strategy Wizard you can setup conditions and variables and then see the generated code in the NinjaScript Editor by clicking the View Code button.

        I'm also providing a link to a pre-recorded set of videos 'Strategy Wizard 301' and 'NinjaScript Editor 401' for you to view at your own convenience.

        Strategy Wizard 301 - https://www.youtube.com/watch?v=FmBi...56536A44DD7105
        NinjaScript Editor 401 - https://www.youtube.com/watch?v=K8v_...56536A44DD7105

        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 help guide first:



        I am also linking you to the Educational Resources section of the Help Guide to help you get started with NinjaScript: http://www.ninjatrader.com/support/h..._resources.htm

        You will find Reference Samples online as well as some Tips and Tricks for both indicators and strategies:

        Click here to see our NinjaScript Reference Samples: http://www.ninjatrader.com/support/f...splay.php?f=30
        Click here to see our NinjaScript Tips: http://www.ninjatrader.com/support/f...ead.php?t=3229

        These samples can be downloaded, installed and modified from NinjaTrader and hopefully serve as a good base for your custom works.

        There is a 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: http://www.ninjatrader.com/support/f...splay.php?f=37

        You can also contact a professional NinjaScript Consultants or Educators who would be eager to create or modify this script at your request or assist you with your script. Please let me know if you would like a list of professional NinjaScript Consultants or Educators who would be happy to create or modify any script at your request or assist you in learning NinjaScript.

        Please let me know if I may be of further assistance.
        Attached Files
        Alan P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by warreng86, 11-10-2020, 02:04 PM
        7 responses
        1,360 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by Perr0Grande, Today, 08:16 PM
        0 responses
        5 views
        0 likes
        Last Post Perr0Grande  
        Started by elderan, Today, 08:03 PM
        0 responses
        9 views
        0 likes
        Last Post elderan
        by elderan
         
        Started by algospoke, Today, 06:40 PM
        0 responses
        10 views
        0 likes
        Last Post algospoke  
        Started by maybeimnotrader, Today, 05:46 PM
        0 responses
        14 views
        0 likes
        Last Post maybeimnotrader  
        Working...
        X