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

BarsPeriods on NT8

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

    BarsPeriods on NT8

    Hello,

    I have a chart with a primary data series of 45 mins and a secondary data series of 5 mins. BarsPeriods[0].Value & BarsPeriods[1].Value report a value of 1. Is this the way it's supposed to work ?
    I was expecting 45 & 5 respectively. NT8 on Windows 10. Thank you.

    Anthony

    #2
    Hi Anthony, thanks for posting.

    My test script is working. Can you reproduce with the script I posted here? To test add the attached file into Documents\NinjaTrader 8\bin\Custom\Indicators and compile>run on a chart and observe the output window.

    Best regards,
    -ChrisL
    Attached Files
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hello Chris,

      It works but on Type = Minute, when Type is other like Heiken Ashi it the period is always at 1. Is there some work around or do I have to hardcode it ? Thanks

      Anthony

      Comment


        #4
        Hi Anthony,

        I was able to get the value with BarsPeriods[0].BaseBarsPeriodValue for the Heiken Aski type.

        Note that you can look at the source code for the default bars types in the platform in the BarsTypes folder for reference.

        Kind regards,
        -ChrisL
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by andrewtrades, Today, 04:57 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by chbruno, Today, 04:10 PM
        0 responses
        6 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Started by josh18955, 03-25-2023, 11:16 AM
        6 responses
        436 views
        0 likes
        Last Post Delerium  
        Started by FAQtrader, Today, 03:35 PM
        0 responses
        7 views
        0 likes
        Last Post FAQtrader  
        Started by rocketman7, Today, 09:41 AM
        5 responses
        19 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X