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

CustomBar type

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

    CustomBar type

    Hi. i was wondering if there is any information out there how to get started when tryin to program a custom bar type. bc i kinda always wanted to do that.

    thanks

    #2
    Hello,

    Thank you for the question.

    For NinjaTrader 7, because these were technically never supported, there is no internal documentation. There are quite a few threads on varied topics spread through the forum which can help with specific topics you may question. The best examples would be the default bar types included with the platform.

    You can view the default code used for all the included bar types by opening the file: Documents\NinjaTrader 7\bin\Custom\Type\@BarsTypes.cs

    You could copy the Class of the type you want to start with into a new file and work from there, this would be concidered a fairly advanced programming task.

    Going forward in NT8, bar types are supported so in the near future there will be further documentation regarding the methods used in a bar type and so on.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      hey. to get started i downloaded
      -

      -
      and put it in my types folder. then i restarted ninjatrader bc no way to compile i guess. but i still cant add it to a chart (i think). shouldnt it appear in the dropdownmenu where i usally add the candle type now?

      Comment


        #4
        Ok, i now tried to add the code or rather the class from the file of that bartype i linked to the @barstypes file in hopes of gettin it to work that way.

        but still nothing showing up in ninjatrader (even after restart). can someone pls explain why it isnt working. do i need to link the bartype in some other file to make it work? i dont get what possibly is goin wrong.

        EDIT: i uploaded both the original file as well as the edited barstypes file, just in case
        Attached Files

        Comment


          #5
          Hello,

          I wanted to provide some details that would assist in custom bar types. Also I have uploaded a stripped down Renko bar type template.

          First, if you have other bar types installed, the initial setup can be difficult in NT7 because there are limited "slots" for bar types. Custom0 - Custom9 and Final0-Final4. If another bartype you have is using one of these slots, yours would not show up so keep this in mind while initially setting up as you may need to change this multiple times until you see your custom type listed.

          In the @BarTypes file, you can copy the entire class for the type you want as a template, so for Renko you would copy the entire:

          Code:
          public class RenkoBarsType : BarsType
          {
          ..
          }
          In the class there are a few items that are critical, first is the class name. After copying this into a new file, you need to change all occurances of "RenkoBarsType" in the new file to your custom name, so : CustomRenkoBarsType.

          The next critical portion would be setting the slot, you will find:

          Code:
          public CustomRenkoBarsType()
          PeriodType.Renko
          {
          }
          This would need to be changed from PeriodType.Renko to PeriodType.Custom0 or any number of a slot that would work with your specific install.

          Now for loading the type. Compile a script and then restart the platform, create a new chart and check for the type. If you do not see it, check the Custom0 and change it to a different value, then repeat the compile and restart.

          Also if you want to use the NinjaScript editor, you can put the type in the indicators folder during development to edit it in NinjaTrader.

          After making these changes, the script should now show up in the menu as an option, keep in mind any changes you do need to restart the platform, this is just the nature of bar types.

          I look forward to being of further assistance.
          Attached Files
          JesseNinjaTrader Customer Service

          Comment


            #6
            thanks that helped.

            the custom0 was the issue aparently. once i changed it to custom9 it finally showed up

            Comment


              #7
              too bad. tho it appears now finally, im not able to click the apply button when the custombar is selected in the dataseries box. i m using ur upload with (like i said) changed custom9.

              any idea where the issue is?

              EDIT: nvm fixed
              Last edited by BigRo; 11-06-2015, 10:09 AM.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by rocketman7, Today, 01:00 AM
              0 responses
              1 view
              0 likes
              Last Post rocketman7  
              Started by wzgy0920, 04-20-2024, 06:09 PM
              2 responses
              27 views
              0 likes
              Last Post wzgy0920  
              Started by wzgy0920, 02-22-2024, 01:11 AM
              5 responses
              32 views
              0 likes
              Last Post wzgy0920  
              Started by wzgy0920, 04-23-2024, 09:53 PM
              2 responses
              74 views
              0 likes
              Last Post wzgy0920  
              Started by Kensonprib, 04-28-2021, 10:11 AM
              5 responses
              193 views
              0 likes
              Last Post Hasadafa  
              Working...
              X