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 louiseruch, Today, 01:11 AM
        0 responses
        1 view
        0 likes
        Last Post louiseruch  
        Started by kujista, Today, 12:39 AM
        0 responses
        3 views
        0 likes
        Last Post kujista
        by kujista
         
        Started by tonynt, 05-21-2019, 06:27 AM
        11 responses
        536 views
        1 like
        Last Post NinjaTrader_Jason  
        Started by fitspressotablettry, Today, 12:36 AM
        0 responses
        1 view
        0 likes
        Last Post fitspressotablettry  
        Started by Lancer, 01-29-2020, 10:15 PM
        7 responses
        469 views
        1 like
        Last Post NinjaTrader_Jason  
        Working...
        X