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 arvidvanstaey, Today, 02:19 PM
        4 responses
        11 views
        0 likes
        Last Post arvidvanstaey  
        Started by samish18, 04-17-2024, 08:57 AM
        16 responses
        61 views
        0 likes
        Last Post samish18  
        Started by jordanq2, Today, 03:10 PM
        2 responses
        9 views
        0 likes
        Last Post jordanq2  
        Started by traderqz, Today, 12:06 AM
        10 responses
        18 views
        0 likes
        Last Post traderqz  
        Started by algospoke, 04-17-2024, 06:40 PM
        5 responses
        48 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X