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

defining special bar types in code

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

    defining special bar types in code

    I have a bar type called:
    RJay renkoSpectrum 2.0 PSSC

    and i would like to use it in my code as the same as this other code.

    if (BarsPeriod.Id == PeriodType.Minute) {Hvn_Line = 2;}
    if (BarsPeriod.Id == PeriodType.Tick) {Hvn_Line = 2;}
    if (BarsPeriod.Id == PeriodType.RJay renkoSpectrum 2.0 PSSC) {Hvn_Line =10;}

    I've tryed several ways but keep getting an error.
    Ninjatrader .data.periodtype Does not contain a definition for RJay renkoSpectrum 2.0 PSSC

    Any help would be appreciated

    #2
    Hello,

    You will need to refer to the base PeriodType. This will be something like Custom0 or Final1, etc.

    You can find this by going to (My) Documents\NinjaTrader 7\bin\Custom\Type and open the .cs file for the bar type you're using.

    In there you should find something such as:

    Code:
    		public .RJayRenkoSpectrum() : base(PeriodType.Custom2)
    		{
    		}
    This is just pesudeo code and your bar type may be different, however you should be able to locate the PeriodType used for this bar type which would be similar to the above.

    Once you know the base period type you can explicitly refer to it in your code by using:

    Code:
    PeriodType.Custom2)
    MatthewNinjaTrader Product Management

    Comment


      #3
      Of corse its not listed in custom/bin....

      I only have the .dll in bin/custom

      It's something I bought and its not open source. Will I not be able to work with it then?

      Comment


        #4
        Hi,

        Yes, in that case you' might want to check with the developer to make sure.

        However you can always try to grab the bars period type by running the following on a chart with that bars type used:

        Code:
        Print(Bars.BarsType.DisplayName + "  " + Bars.BarsType.Period.Id.ToString());
        The Bars.BarsType.Period.Id should get you what you're looking for.
        MatthewNinjaTrader Product Management

        Comment


          #5
          Ty, that found it


          odd...
          its Custom4
          but its not liking it at all, it compiles but makes other charts not work correctly, very odd
          Last edited by ghostpipper; 11-15-2013, 09:24 AM.

          Comment


            #6
            Originally posted by ghostpipper View Post
            Ty, that found it


            odd...
            its Custom4
            but its not liking it at all, it compiles but makes other charts not work correctly, very odd
            Hi ghostpipper,

            If you need assistance, contact me.

            RJay
            RJay
            NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by jclose, Today, 09:37 PM
            0 responses
            5 views
            0 likes
            Last Post jclose
            by jclose
             
            Started by WeyldFalcon, 08-07-2020, 06:13 AM
            10 responses
            1,414 views
            0 likes
            Last Post Traderontheroad  
            Started by firefoxforum12, Today, 08:53 PM
            0 responses
            11 views
            0 likes
            Last Post firefoxforum12  
            Started by stafe, Today, 08:34 PM
            0 responses
            11 views
            0 likes
            Last Post stafe
            by stafe
             
            Started by sastrades, 01-31-2024, 10:19 PM
            11 responses
            169 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Working...
            X