• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SMA Color Change Indicator

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

    SMA Color Change Indicator

    Hello all,

    I have a useful Indicator that measures the slope angle of a sma, thus giving the prevailing trend direction and colors the SMA line green for slope up and red for slope down and black for flat or no slope.

    I have unfortunately noticed that in active moving markets that at times I noticed that once a bar close and prints a color for that SMA line, that sometimes the indicator repaints 2 bars back and changes the previous closed color. Thus making back testing and live markets look different.

    Can anyone please help in changing the repaint option in the code. I would highly appreciate it. Even perhaps a audio alert for trend up or trend down.

    Very simple but very useful indicator for all. I hope you find a home for it in your strategy. Thank You in advance.
    Attached Files

    #2
    Hello denalek2419,

    Thank you for your post and welcome to the NinjaTrader Support Forum!

    Is this an indicator you have created or a third party?

    The redraw is occurring when the Plots are being set 1 bar back with a new color based on the conditions. For example:
    Code:
    				if(sma34slope>=angle2)
    				{
    					SMAslopeup.Set(1,SMA(Period)[1]); // this sets the slope up plot 1 bar back
    					SMAslopeup.Set(SMA(Period)[0]);
    				}
    There are several plots that are using different colors and then being set to the SMA(period).

    Please take a look at our multi-color plot sample at the following link: http://ninjatrader.com/support/forum...ead.php?t=3227
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_PatrickH View Post
      Hello denalek2419,

      Thank you for your post and welcome to the NinjaTrader Support Forum!

      Is this an indicator you have created or a third party?

      The redraw is occurring when the Plots are being set 1 bar back with a new color based on the conditions. For example:
      Code:
      				if(sma34slope>=angle2)
      				{
      					SMAslopeup.Set(1,SMA(Period)[1]); // this sets the slope up plot 1 bar back
      					SMAslopeup.Set(SMA(Period)[0]);
      				}
      There are several plots that are using different colors and then being set to the SMA(period).

      Please take a look at our multi-color plot sample at the following link: http://ninjatrader.com/support/forum...ead.php?t=3227
      Thank you for the input. I have made the adjustments and will compare and contrast. The indicator is public domain.

      Thanks!!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by tvaughan4, 12-13-2019, 10:46 PM
      2 responses
      15 views
      0 likes
      Last Post tvaughan4  
      Started by digibob, 12-13-2019, 10:01 PM
      3 responses
      12 views
      0 likes
      Last Post digibob
      by digibob
       
      Started by ldissinger, Yesterday, 12:55 PM
      1 response
      17 views
      0 likes
      Last Post ldissinger  
      Started by pstrusi, Yesterday, 09:06 AM
      1 response
      27 views
      0 likes
      Last Post marcus2300  
      Started by vpzdcv, Yesterday, 02:31 AM
      0 responses
      13 views
      0 likes
      Last Post vpzdcv
      by vpzdcv
       
      Working...
      X