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

Indicator Loads but Doesn't Load on Strategy

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

    Indicator Loads but Doesn't Load on Strategy

    Hi!

    I'm working with the indicator that I requested to be fixed in this thread: https://ninjatrader.com/support/foru...-with-strategy , which NinjaTrader_Kate did (and I'm very grateful for that)

    However, when I try to create a strategy using this indicator, the strategy simply won't work at all. I'm loading it onto MES's 1 minute chart on 1/24 and have the logic attached below for the strategy. As you can see, it's a simple system that only enters a trade if there's a buy signal (buy signal being above 25 in this case only really means that the buy signal is not 0). However, it has failed to generate a single trade on backtest (even though there were dozens of instances of buy signals on MES being >25 throughout the time tested, if the indicator was simply loaded separately). By the way for the sake of verifying that the indicator was the only thing malfunctioning, I created the strategy shown with no other conditions other than what NinjaTrader had.

    Initially, I thought that this error may have occurred due to the opacity's default value being 25, and whenever the indicator was loaded separately, it changed it from 25 to 10, so I simply changed the default opacity in the source code for the indicator from 25 to 10, but that didn't help. I also thought the error might have occurred from the "maximum bars look back" variable in the strategy builder, but changing that from 256 to Infinite made no difference either.

    I would also like to note that despite me hitting "Plot on Chart" in strategy builder, the indicator doesn't Plot, so I believe it has some internal error which results in it not working.
    It's also worth stating that I did check the Log for errors prior to posting, and there were not any.
    Uninstalling the indicator and reinstalling it (believing I might have tampered with it too much) and reloading it again into a new strategy doesn't work either.

    I'm at my wit's end at this point and I'd really appreciate support. Thank you!

    #2
    Hello,

    Thank you for your post.

    I've taken a look at this and what was happening was that when the strategy calls the indicator, the indicator reaches State.DataLoaded before it actually gets added to the chart so the bool that controls whether or not it plots wasn't getting flipped. I've changed this so it will only check if it's on the chart once it's in OnBarUpdate, which should eliminate the issue.

    I've attached both the updated indicator and a test strategy. When you import this, if it asks if you want to update the DivergenceSpotterV2 indicator, say yes so the corrected one gets installed. I'll update this on the App Share as well.

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

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by fx.practic, 10-15-2013, 12:53 AM
    5 responses
    5,403 views
    0 likes
    Last Post Bidder
    by Bidder
     
    Started by Shai Samuel, 07-02-2022, 02:46 PM
    4 responses
    94 views
    0 likes
    Last Post Bidder
    by Bidder
     
    Started by DJ888, Yesterday, 10:57 PM
    0 responses
    6 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by MacDad, 02-25-2024, 11:48 PM
    7 responses
    158 views
    0 likes
    Last Post loganjarosz123  
    Started by Belfortbucks, Yesterday, 09:29 PM
    0 responses
    8 views
    0 likes
    Last Post Belfortbucks  
    Working...
    X