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

Some signals do not show in real-time but shows in refreshed chart

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

    #16
    Hi Chelsea,

    I have inserted those statements at line 175 of the original Swing indicator. So it looks like this
    Code:
    if (saveCurrentBar != CurrentBar)
    {
         // bunch of code
    } 
    else
    {
            // update the caches
    	if (High[0] > (double) lastHighCache[lastHighCache.Count - 1])
    		lastHighCache[lastHighCache.Count - 1] = High[0];
    	if (Low[0] < (double) lastLowCache[lastLowCache.Count - 1])
    		lastLowCache[lastLowCache.Count - 1] = Low[0];
    
            if (High[0] > High[strength] && swingHighSwings[strength] > 0.0)
    	{
    		swingHighSwings.Set(strength, 0.0);
    		for (int i=0; i<=strength; i++)
    			SwingHighPlot.Reset(i);
    		currentSwingHigh = 0.0;
    	}
            .... continue with rest of code.....
    }
    You should see the difference when you run it with COBC = false. Previously the indicator would plot the dots incorrectly using the value first stored in the cache, which was essentially the Open of the bar, rather than the high/low, so the dots would 'cut across' the bar.

    Hope this helps.

    Comment


      #17
      Hello wintermelon,

      Thanks for the direction there.

      Nice work on this indicator. It does indeed fix the plots from starting at the open to the low or high when COBC is set to false.

      I do notice that the plots do not extend as far as they should, I will attempt to correct that and then I will repost the script.

      Thanks again for your good work wintermelon.
      Chelsea B.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by r68cervera, Today, 05:29 AM
      0 responses
      2 views
      0 likes
      Last Post r68cervera  
      Started by geddyisodin, Today, 05:20 AM
      0 responses
      3 views
      0 likes
      Last Post geddyisodin  
      Started by JonesJoker, 04-22-2024, 12:23 PM
      6 responses
      35 views
      0 likes
      Last Post JonesJoker  
      Started by GussJ, 03-04-2020, 03:11 PM
      12 responses
      3,239 views
      0 likes
      Last Post Leafcutter  
      Started by AveryFlynn, Today, 04:57 AM
      0 responses
      6 views
      0 likes
      Last Post AveryFlynn  
      Working...
      X