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

Instrument / Timeframe within Indicator

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

    Instrument / Timeframe within Indicator

    Support,

    I didn't know how to search for my answer, so please pardon this question if it is redundant and feel free to direct me to the proper thread if available.

    My question has to do with Multiple Timeframes within a Strategy. Instead of using multiple timeframes in a strategy and all the things to remember as a result of doing so, e.g. Which bar in progress, using the right overloads for limit entries, etc., is there a way to pass a parameter to an indicator telling it which timeframe and instrument to calc on?

    Here is my first thought: The indicator uses the timeseries of the strategy. But if I used a granular timeseries like say 30 seconds or something, I could pass a parameter to the strategy that says calculate based on 30x10, or every 300 seconds.

    I would like to keep additional timeframes out of my strategy if possible and just pass what I need to calculate as a parameter. But my gut tells me that I need to take the granular approach.

    Please know I almost never work with Indicators, 90% of my efforts are with Strats, so please feel free to chime in anyone if you have a creative solution for multi-timeframe and indicators, but calculating outside of the strategy.

    Example> Say I want the SMA of 10m timeframe on ES as an overall indicator for direction (trend up / down). As I do it now, I need to use the Add within my strategy and make sure I have the right number of bars, but bars for that timeframe, and then peel off logic for that bars in progress and then use overloads for limit orders, etc.

    It is not impossible of course, but you are tired, it gets old trying to remember what is what and if I could keep it outside my strategy and just let the indicator push back the value I want and leave the timeframe/instrument specific to the indicator, it would be much cleaner.

    I remember getting into this during intra-strategy communication. Anyway, I'm all ears if anyone can share.


    Thank you,


    r2kTrader

    #2
    Hi r2kTrader,

    Perhaps some others have suggestions on clever coding or workarounds. With NT7, you can create multi-series indicators, and call those. Perhaps you could simulate longer length SMA's as in your example, by calling say either a 3 period SMA on a 1hr chart, or 180 period SMA on a minute chart, for example.
    TimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by trilliantrader, Today, 08:16 AM
    2 responses
    6 views
    0 likes
    Last Post trilliantrader  
    Started by samish18, Today, 08:31 AM
    1 response
    1 view
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by Creamers, 09-08-2023, 10:26 AM
    6 responses
    157 views
    0 likes
    Last Post JonyGurt  
    Started by funk10101, Today, 08:14 AM
    1 response
    2 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by bill2023, Yesterday, 08:51 AM
    3 responses
    22 views
    0 likes
    Last Post bltdavid  
    Working...
    X