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

Custom strategy indicator is only showing up on backtest chart and no on live chart

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

    Custom strategy indicator is only showing up on backtest chart and no on live chart

    As the title indicates, I have create a custom strategy. That strategy adds 2 indicators to the chart. When I backtest the strategy and navigate to the chart tab, I can see that the indicators were added to the chart. When I add my strategy to a live chart, the indicators do not show up. The live chart is showing that my strategy was added, which I can see in the upper-left corner of the chart. (see attached screenshots)

    Code that adds the chart indicators

    Code:
                else if (State == State.DataLoaded)
                {
                    //
                    // reset local variables (needed if 'IsInstantiatedOnEachOptimizationIteration'    == false)
                    //
                    highestAccountSize = 0;
                    maxDrawdown = 0;
                    startingAccountSize = 0;
    
                    //
                    // intialize indicators
                    //
                    moonshotVolSignals = MoonshotVolSignals(microPeriod, macroStdDevSmoothingPeriod, stdDevEntry, 1);            
                    switch (directionalIndicator)
                    {
                        case DirectionalIndicators.RSI:
                          rsi = RSI(microPeriod, 1);
                          break;
                        case DirectionalIndicators.RVI:
                          rvi = RVI(microPeriod);
                          break;
                        default:
                          break;
                    }
    
    [B]                //
                    // Add to chart
                    // [/B]                           
    [B]                switch (directionalIndicator)
                    {
                        case DirectionalIndicators.RSI:
                          AddChartIndicator(rsi);
                          break;
                        case DirectionalIndicators.RVI:
                          AddChartIndicator(rvi);
                          break;
                        default:
                          break;
                    }[/B]
    
                      AddChartIndicator(moonshotVolSignals);
                }

    #2
    Hello krugman25,

    Thank you for the post.

    The only observation I can make here is that the strategy on the chart is not enabled, it has a (D) next to its name indicating its disabled. That one should not be showing anything at this point, was that just a wrong image or is that the problem that the strategy is disabled?

    Another way to go about testing this would be to check if the SampleMACrossOver shows up, that also uses AddChartIndicator.


    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      Hello krugman25,

      Thank you for the post.

      The only observation I can make here is that the strategy on the chart is not enabled, it has a (D) next to its name indicating its disabled. That one should not be showing anything at this point, was that just a wrong image or is that the problem that the strategy is disabled?

      Another way to go about testing this would be to check if the SampleMACrossOver shows up, that also uses AddChartIndicator.


      I look forward to being of further assistance.
      Wow, that is really embarrassing. I don't know how I missed that one, but that is exactly what it was. Thank you!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by pechtri, 06-22-2023, 02:31 AM
      9 responses
      122 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by frankthearm, 04-18-2024, 09:08 AM
      16 responses
      65 views
      0 likes
      Last Post NinjaTrader_Clayton  
      Started by habeebft, Today, 01:18 PM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by benmarkal, Today, 12:52 PM
      2 responses
      13 views
      0 likes
      Last Post benmarkal  
      Started by f.saeidi, Today, 01:38 PM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Working...
      X