• 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

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
      -
      http://ninjatrader.com/support/forum...d=4&linkid=560
      -
      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 rontronimous, Today, 06:12 PM
              1 response
              3 views
              0 likes
              Last Post NinjaTrader_ShawnB  
              Started by Vinhasa, Today, 03:15 PM
              3 responses
              13 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by 1001111, Today, 03:03 PM
              1 response
              9 views
              0 likes
              Last Post NinjaTrader_Tyler  
              Started by Seedbird, Today, 03:06 PM
              1 response
              13 views
              0 likes
              Last Post NinjaTrader_BrendanC  
              Started by mtamaku, Today, 02:46 PM
              1 response
              7 views
              0 likes
              Last Post NinjaTrader_Kate  
              Working...
              X