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

Multi-Timeframe SMAs

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

    Multi-Timeframe SMAs

    I'm trying to making an indicator with multiple timeframe SMAs all in one. Ideally, I would like to have 2 SMAs with different periods on the daily timeframe, 2 on the weekly, and 2 on the monthly.

    So far, I've been able to plot a 20 day moving average and 20 week moving average, both on the daily chart.

    However, I can't seem to figure out how to implement the following features:
    1. Plot the monthly timeframe moving average as well on the daily chart
    2. Hide smaller timeframe moving averages on higher timeframes (e.g. hide the daily SMAs on the weekly/monthly charts)
    3. Plotting a second set of moving average per timeframe with a different period (This one is less important as I can just have a second indicator - although I would like all in one if possible)

    See indicator attached. If anyone can help nudge me in the right direction I would appreciate it.
    Attached Files

    #2
    Hello Splex,

    A plot will need consecutive bars (for the primary series) set to plot.

    This means if you are only setting the plot when a month bar closes, then on each day bar where this is not set, you would want to set the plot to the value of the previous bar.

    You can compare the BarsPeriod.BarsPeriodType and .Value to ensure the bar type is an acceptable bar type.

    Below are public links to the help guide.



    Below is a link to a reference sample that demonstrates using an added series as an input series for an indicator.
    Note: In NinjaTrader 8 It is no longer needed to use an indicator to sync a secondary series. This can be done directly from the Series<T> (https://ninjatrader.com/support/helpGuides/nt8/NT%20HelpGuide%20English.html?seriest.htm) constructor. This post is left for historical purposes. Series objects are useful for
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by cre8able, Today, 03:20 PM
    0 responses
    2 views
    0 likes
    Last Post cre8able  
    Started by Fran888, 02-16-2024, 10:48 AM
    3 responses
    46 views
    0 likes
    Last Post Sam2515
    by Sam2515
     
    Started by martin70, 03-24-2023, 04:58 AM
    15 responses
    114 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by The_Sec, Today, 02:29 PM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by jeronymite, 04-12-2024, 04:26 PM
    2 responses
    31 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Working...
    X