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 Kaledus, Today, 01:29 PM
    5 responses
    12 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by Waxavi, Today, 02:00 AM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Started by alifarahani, Today, 09:40 AM
    5 responses
    23 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by gentlebenthebear, Today, 01:30 AM
    3 responses
    16 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by PhillT, Today, 02:16 PM
    2 responses
    7 views
    0 likes
    Last Post PhillT
    by PhillT
     
    Working...
    X