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

Assign a number to each bar on the chart

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

    Assign a number to each bar on the chart

    I want to make an indicator that would assign a number to each bar on my chart and print that number on the chart by the bar. The number would vary based on some simple math regarding the opens or closes of previous bars. I would then like my separate strategy to "read" those numbers, and place trades in reference to them.

    Example: when current bar's value is 24 enter long.

    I did find the indicator "BarCouner" it has potential, but getting my strategy to "read" the indicators numbers is leaving me stuck.

    #2
    Hello ron456,
    Thanks for your post.

    You mentioned the number of the bar would vary depending on some basic math, but it looks like the number you are drawing above each bar is simply for identifying that unique bar? Could you use CurrentBar?



    Josh G.NinjaTrader Customer Service

    Comment


      #3
      The pic is from the indicator "BarCounter". I will need to edit it to get the calculations and numbers I want. It seems to be a good starting point. Unless some one knows of a better starting point? But My bigger concern is how to get my strategy to "Read" the numbers that my indicator prints.

      Comment


        #4
        ron456,

        The easiest way would probably be to use the same variable for your calculations as you do for the string input of your Draw method.
        Josh G.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Segwin, 05-07-2018, 02:15 PM
        14 responses
        1,788 views
        0 likes
        Last Post aligator  
        Started by Jimmyk, 01-26-2018, 05:19 AM
        6 responses
        837 views
        0 likes
        Last Post emuns
        by emuns
         
        Started by jxs_xrj, 01-12-2020, 09:49 AM
        6 responses
        3,293 views
        1 like
        Last Post jgualdronc  
        Started by Touch-Ups, Today, 10:36 AM
        0 responses
        12 views
        0 likes
        Last Post Touch-Ups  
        Started by geddyisodin, 04-25-2024, 05:20 AM
        11 responses
        62 views
        0 likes
        Last Post halgo_boulder  
        Working...
        X