• 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

creating a simple indicator

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

    creating a simple indicator


    Good afternoon.
    I would like to help to create a simple indicator.
    It will not get information from the chart, it will just draw regions using fixed values that I will report daily.
    I will enter VAR1 and VAR2 and would like the indicator to draw the regions according to the formula result:

    x1 = var1 + (2.00 * var2);
    x2 = var1 + (2.5 * var2);
    x3 = var1- (2.00 * var2);
    x4 = var1- (2.5 * var2);

    x5 = var1 + (4.00 * var2);
    x6 = var1 + (4.5 * var2);
    x7 = var1- (4.00 * var2);
    x8 = var1- (4.5 * var2);

    Attached image of how I would like it to look on the chart.
    Thank you.

    #2
    Hello guigs88,

    Thanks for your post.

    You might want to look at a couple of indicators in the NT user app section (NinjaTrader Ecosystem website) that are free to download and use. The indicator "Repeater" would allow you to specify up to 10 events on a daily basis. One of the event types is a "price region" where you specify an upper and lower price (start and end) and the indicator will draw the region at the specified levels. The indicator can also do other things but thought you might want to check into it, here is a link: https://ninjatraderecosystem.com/use...load/repeater/

    Also, the indicator ColorZone3 may be a good starting point for creating your own if it does not meet your needs: https://ninjatraderecosystem.com/use.../colorzone3-2/

    Please note: The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.


    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Based on the indicators you sent me, I was able to do what I needed. Thank you!

      Comment


        #4
        Hello .. Good night.
        I am encountering the following error when I try to insert the indicator into the chart. Can you help me?

        2019-08-20 19:54:32:768 ERROR: Indicator 'ZONAS': Error on calling 'OnBarUpdate' method on bar 3: You are accessing an index with a value that is invalid since it is out-of-range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.

        Tks..
        Attached Files

        Comment


          #5
          Hello guigs88,

          Thanks for your reply.

          The particular error above indicates that the indicator is trying to access a bar that it has not loaded yet. The indicator will start on the very first historical bar and begin processing according to the code in your script. The error would occur if for example on bar number 3 you tried to access a value such as High[4] because the 4th bar would not be loaded. Typically this error would be resolved by checking to see if the CurrentBar being processed is greater than the farthest back bar being access, please see: https://ninjatrader.com/support/help...currentbar.htm

          You may need to use print statements to debug your script. Please see our debug tips here: https://ninjatrader.com/support/help...script_cod.htm

          Please note that we do not provide code writing or debugging services.

          Alternately, if you would like your indicator created for you, we can provide references to 3rd party programmers.
          Paul H.NinjaTrader Customer Service

          Comment


            #6
            Originally posted by guigs88 View Post
            Hello .. Good night.
            I am encountering the following error when I try to insert the indicator into the chart. Can you help me?

            2019-08-20 19:54:32:768 ERROR: Indicator 'ZONAS': Error on calling 'OnBarUpdate' method on bar 3: You are accessing an index with a value that is invalid since it is out-of-range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.

            Tks..
            In my attached image, there is an error with Values[63]. I counted your AddPlot and it looks like you are missing one. If you count from 0, I only count 62, so referencing 63 will throw an error.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by ketoproplus, Today, 05:08 AM
            0 responses
            1 view
            0 likes
            Last Post ketoproplus  
            Started by asmmbillah, Today, 03:55 AM
            0 responses
            1 view
            0 likes
            Last Post asmmbillah  
            Started by cmarkb, Today, 12:04 AM
            0 responses
            4 views
            0 likes
            Last Post cmarkb
            by cmarkb
             
            Started by supernova0219, Yesterday, 07:48 PM
            0 responses
            7 views
            0 likes
            Last Post supernova0219  
            Started by qwfxny, Yesterday, 07:20 PM
            0 responses
            9 views
            0 likes
            Last Post qwfxny
            by qwfxny
             
            Working...
            X