Announcement

Collapse
No announcement yet.

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.

    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 NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      56 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      133 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      73 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      45 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      49 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X