• 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 quantera, Today, 05:38 PM
      0 responses
      1 view
      0 likes
      Last Post quantera  
      Started by ciro1963, Today, 03:58 PM
      0 responses
      2 views
      0 likes
      Last Post ciro1963  
      Started by swcooke, Today, 02:48 PM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by SOFI777, Today, 01:03 PM
      5 responses
      29 views
      0 likes
      Last Post SOFI777
      by SOFI777
       
      Started by Gerard111, 09-23-2015, 07:25 AM
      2 responses
      1,207 views
      0 likes
      Last Post NinjaTrader_ChristopherD  
      Working...
      X