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

Gradient Shading Between two EMA's

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

    #16
    Hello Kaiviti57,
    As of yesterday there was some issue with the trend definition which you're more clear now so hope you can define the conditions. If the conditions are evaluated for double variable it means for all past bars also the new values will be invoked & that is the basic reason for same region being plotted for all data, so you're getting region as per current trend. That's why I suggested you to convert your double to series & compare the series @ currentbar so your old regions will be unaffected by new trend.
    Consider below logic:-

    if( rsi[0] > (avg[0] + Band[0] ))
    <up region>
    else if( rsi[0] < (avg[0] + Band[0] ))
    <dn region>
    else if( Math.Abs(rsi[0] - avg[0]) == Band[0] )
    <nl region>

    And be sure to add currentbar index to region tag so you get all regions plotted.
    Hope it helps.

    Comment


      #17
      s.kinra, I really appreciate the time you are taking to help me out. I think I have done everything you have suggested and it is still not working. Please see the attached screenshot that shows how it is currently plotting. I have also marked a few places where there should be some yellow bands and also where there should be a red section.

      The code I am using at the moment is also attached
      Attached Files
      Last edited by Kaiviti57; 09-10-2020, 05:28 PM.

      Comment


        #18
        FANTASTIC!!! I now have the indicator plotting the previous with the correct coloring. I went back to my original script and changed all the references to the current bar to one bar back. Now I need to figure out how to paint the current bar as it is forming. I am now going to start a new thread for this part.
        Last edited by Kaiviti57; 09-10-2020, 09:06 PM.

        Comment


          #19
          Great job Kaiviti57, always good to see stuff working after struggle.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by agclub, 04-21-2024, 08:57 PM
          5 responses
          34 views
          0 likes
          Last Post agclub
          by agclub
           
          Started by ESHunter, Today, 08:06 PM
          2 responses
          18 views
          0 likes
          Last Post ESHunter  
          Started by ETFVoyageur, 05-07-2024, 07:05 PM
          19 responses
          150 views
          0 likes
          Last Post ETFVoyageur  
          Started by ETFVoyageur, Yesterday, 10:13 PM
          3 responses
          26 views
          0 likes
          Last Post ETFVoyageur  
          Started by ETFVoyageur, Yesterday, 12:52 AM
          3 responses
          33 views
          0 likes
          Last Post ETFVoyageur  
          Working...
          X