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

Strategy Sharing Indicators with Custom Indicator

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

    Strategy Sharing Indicators with Custom Indicator

    Goal: Create an custom indicator that can access and use multi-timeframe(MTF) close prices and indicators from the main Strategy to plot in a panel. I don't want to code the logic twice, once in Strategy and again in the Radar indicator. I would prefer to avoid creating the 3 indicators and MTF dataseries in the Strategy and custom indicator.

    I have a Strategy that uses 3 standard indicators and price for 3 time frames. I created an 4th custom indicator called "Radar" that I want to plot (in a panel) a visual of certain states (downtrend, uptrend, sideways, buy signals, etc) from the Strategy. The Strategy uses the 3 indicators to determine these states and signals. I've coded the Strategy to give the 4th Radar indicator access to the 3 indicators. The Strategy creates/instantiates the 4th Radar indicator after the 3 standard indicators to ensure the first 3 process first and have updated values for the 4th Radar indicator to use.

    By the time the 4th custom Radar indicator OnBarUpdate() gets called the other 3 indicators and closes[] will be done processing and available to the Radar indicator OnBarUpdate(). Will this sharing Strategy Indicators with another indicator work with the event sequence in NinjaTrader? If not, can you recommend another way to achieve this type of sharing?

    Thanks!

    #2
    Hello Sorcerysoft,

    Thank you for your post.

    I apologize for the delay in replying - we had a technical issue with our forum and it was offline for a couple days.

    You would need to create the 4th indicator, adding the series and standard indicators and calculate the states (downtrend, uptrend, sideways, buy signals, etc), then you would need to add the series in the strategy and instantiate the 4th indicator. This would be because the system allows for indicators to be instantiated within a strategy but not the other way around.

    Alternatively you could look into plotting directly from the strategy. Here's an example of how you can plot from the strategy:



    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by judysamnt7, 03-13-2023, 09:11 AM
    4 responses
    55 views
    0 likes
    Last Post DynamicTest  
    Started by ScottWalsh, Today, 06:52 PM
    4 responses
    35 views
    0 likes
    Last Post ScottWalsh  
    Started by olisav57, Today, 07:39 PM
    0 responses
    7 views
    0 likes
    Last Post olisav57  
    Started by trilliantrader, Today, 03:01 PM
    2 responses
    19 views
    0 likes
    Last Post helpwanted  
    Started by cre8able, Today, 07:24 PM
    0 responses
    8 views
    0 likes
    Last Post cre8able  
    Working...
    X