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

make the higher time frame a set ratio to the main data series

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

    make the higher time frame a set ratio to the main data series

    I want to code my indicator so that I can put an int in the ui and the secondary data series takes that int and multiplies it by the main data series bar time frame and uses the result for the higher time frames bar series. This should be possible assuming i can call the time period directly.

    For example, if the main data series is 5m and the higher time period ([1] in the array) has an int value that it derives its values from like this:

    AddDataSeries(HigherTimeFramePeriodType, HigherTimeFramePeriod);

    Is there code i can use to assign the value of an int we'll call "multiplier" that is accessible via the UI and multiply it by the [0] array data series period amount assuming they will all be using minute period type.

    so int HigherTimeFramePeriod = multipllier(3) x primary data series time frame(5m) resulting in a value of (15)

    Is this possible and if so how do I do i code this? Thanks in advance.
    Last edited by gordongekko; 01-09-2018, 04:33 PM.

    #2
    Hello gordongekko,

    Thanks for your question.

    The code generation wizards in the NinjaScript Editor can show you the syntax for creating user defined input parameters. To open a code generation wizard, right click on a NinjaScript folder in the NinjaScript Explorer and select the "New" context menu item.

    For example, for Indicators, right click the indicator folder and select New Indicator. Create your inputs under Input Parameters and click Generate.

    You may also reference how to create your own user defined inputs in the Tip found in our Forums here: https://ninjatrader.com/support/foru...ead.php?t=5782

    The time frame of the primary instrument can be observed through BarsPeriod.

    Keep in mind, it is not advised to create a dynamically added data series in NinjaTrader 8 since many objects cannot be accessed reliably from State.Configure. (Adding an additional data series based off of an input parameter.) Please see the AddDataSeries() documentation for more information.

    I've included publicly available documentation links on the items discussed. Please see the Notes and Warnings sections of these documentation items for a full understanding of any caveats involved.

    AddDataSeries() - https://ninjatrader.com/support/help...dataseries.htm

    BarsPeriod - https://ninjatrader.com/support/help...barsperiod.htm

    Please let me know if I can be of further help.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by jaybedreamin, Today, 05:56 PM
    0 responses
    3 views
    0 likes
    Last Post jaybedreamin  
    Started by DJ888, 04-16-2024, 06:09 PM
    6 responses
    18 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by Jon17, Today, 04:33 PM
    0 responses
    1 view
    0 likes
    Last Post Jon17
    by Jon17
     
    Started by Javierw.ok, Today, 04:12 PM
    0 responses
    6 views
    0 likes
    Last Post Javierw.ok  
    Started by timmbbo, Today, 08:59 AM
    2 responses
    10 views
    0 likes
    Last Post bltdavid  
    Working...
    X