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

new type of bar

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

    new type of bar

    I had an idea for a new type of bar based off of a range bar. I unfortunately have no idea where to even start on something like this. I was hoping someone could give me an idea of how to go about programming a type of bar. Any help would be greatly appreciated.

    #2
    Hello laces2,

    Creating custom bar types is unfortunately not supported by NinjaTrader. However, you can review source code for existing bar types and could create your own as well. You will need something like Visual studio or a text editor to open this file here:
    Documents\NinjaTrader 7\bin\custom\type\@BarTypes.cs

    You could also take a look at the source code for indicator HeikenAshi, which is a kind of bar type but developed as indicator. Can view this using Tools > Edit NinjaScript > Indicator > Select HeikenAshi and open.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      There have been a few hacks at custom bar types, and some bar types now available exist because they were first started as unsupported programming by users.

      The ability to program a custom bar type exits within NT, but it isn't documented or supported. If you'd like to see NT document and suppport custom bar types, please add your vote to the below thread.

      Comment


        #4
        Thank you for the help. Looks like I have a lot more homework ahead of me than I thought. If I manage to make it happen I will post how I went about it.

        Comment


          #5
          Originally posted by laces2 View Post
          Thank you for the help. Looks like I have a lot more homework ahead of me than I thought. If I manage to make it happen I will post how I went about it.

          Hi lace2,

          Creating new bar types is time consuming because the normal tools for creating indicators are not available. The output window and the print command do not function with chart types. Also you have to restart NT after every change to activate the new change on the chart.

          I have created 4 new chart types myself over the last three years.

          It was well worth it to me to create exactly what I wanted.

          Good luck with your project,

          RJay
          RJay
          NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

          Comment


            #6
            laces2, I've recently accomplished developing new type of bars. I did it as indicator having HeikenAshi as an example. I'd definitely advise you to follow that way. I don't really see any flaws in that compared to developing it as native custom BarType. Moreover it seems to me as much easier way, especially if you just start.

            Comment


              #7
              Originally posted by danilam View Post
              laces2, I've recently accomplished developing new type of bars. I did it as indicator having HeikenAshi as an example. I'd definitely advise you to follow that way. I don't really see any flaws in that compared to developing it as native custom BarType. Moreover it seems to me as much easier way, especially if you just start.
              I like the idea of going the Indicator route, since it makes development easier (not having to restart NT for each change, etc).

              However, I'm looking at @HeikenAshi.cs as a guide, but I fail to see how to force a new bar. It seems the bar type of the chart affects how it outputs. For example, if I put the HeikenAshi on a 3-min chart versus a 1597T chart, I will get a very different output. Thus, not really a new bar type. Instead a bar type modifier.

              I imagine going the indicator route is not going to work for me.

              Is there any examples out there for going the, actual, new bar type route?

              Any help is greatly appreciated,
              Daniel

              Comment


                #8
                Originally posted by neoikon View Post
                .. For example, if I put the HeikenAshi on a 3-min chart versus a 1597T chart, I will get a very different output. ...
                Daniel
                Is that not true of any and every bar type? If you change the time parameters of the chart, the bars show up differently. Am I misunderstanding something here?

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by bortz, 11-06-2023, 08:04 AM
                47 responses
                1,607 views
                0 likes
                Last Post aligator  
                Started by jaybedreamin, Today, 05:56 PM
                0 responses
                9 views
                0 likes
                Last Post jaybedreamin  
                Started by DJ888, 04-16-2024, 06:09 PM
                6 responses
                19 views
                0 likes
                Last Post DJ888
                by DJ888
                 
                Started by Jon17, Today, 04:33 PM
                0 responses
                6 views
                0 likes
                Last Post Jon17
                by Jon17
                 
                Started by Javierw.ok, Today, 04:12 PM
                0 responses
                15 views
                0 likes
                Last Post Javierw.ok  
                Working...
                X