Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Custom Bars Types

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

    Custom Bars Types

    Hi, I'm trying to create a custom bar type that tracks the notional value of the volume traded. This often results in a value that is a long data type. To do this I've created a custom bars type which is BuiltFrom = BarsPeriodType.Tick, however the problem I am running into is that BarsPeriod.Value seems to only accept integers. Is this true? Is there a way to get the period to be a long?

    #2
    Hello NickyD,

    Thank you for your post.

    The BarsPeriod.Value may only be an integer value. As mentioned on the following help guide page, BarsPeriod.Value:
    Determines an integer value representing the period parameter.
    • When using Kagi Bars objects this represents the "reversal" parameter
    • When using LineBreak Bars objects this represents the "lineBreakCount" parameter
    • When using PointAndFigure Bars objects this represents the "boxSize" parameter
    • When using Renko Bars objects this represents the "brickSize" parameter​
    https://ninjatrader.com/support/help...barsperiod.htm

    Depending on your needs, you may be able to use an indicator script instead that changes how the bars are rendered visually on the chart based on different calculations. There is a Heiken Ashi indicator that you could use as an example of this. This indicator is publicly available on our NinjaTrader Ecosystem website:Here is a basic guideline of how to import NinjaScript add-ons in NinjaTrader 8:

    Note — To import NinjaScripts you will need the original .zip file.

    To Import:
    1. Download the NinjaScripts to your desktop, keep them in the compressed .zip file.
    2. From the Control Center window select the menu Tools > Import > NinjaScript Add-on...
    3. Select the downloaded .zip file
    4. NinjaTrader will then confirm if the import has been successful.

    Critical - Specifically for some NinjaScripts, it will prompt that you are running newer versions of @SMA, @EMA, etc. and ask if you want to replace, press 'No'

    Once installed, you may add the indicator to a chart by:
    • Right-click your chart > Indicators... > Select the Indicator from the 'Available' list on the left > Add > OK

    Here is a short video demonstration of the import process:
    Please let me know if I can be of further assistance.

    The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    599 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    344 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    558 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    557 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X