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 BarzTrading, Today, 07:25 AM
        2 responses
        21 views
        1 like
        Last Post BarzTrading  
        Started by devatechnologies, 04-14-2024, 02:58 PM
        3 responses
        20 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by tkaboris, Today, 08:01 AM
        0 responses
        4 views
        0 likes
        Last Post tkaboris  
        Started by EB Worx, 04-04-2023, 02:34 AM
        7 responses
        163 views
        0 likes
        Last Post VFI26
        by VFI26
         
        Started by Mizzouman1, Today, 07:35 AM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X