Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Color Change based on a Moving Average

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

    Color Change based on a Moving Average

    Not sure, if it's being asked around on the site but curious if anyone has an indicator where the price line would change color depending on if it's above or below the moving average. Similar to the picture below.

    Click image for larger version

Name:	vfDzIPD.png
Views:	94
Size:	669.3 KB
ID:	1137430


    #2
    Hello harryodell55, thanks for your post.

    The "Price Line" indicator comes with the platform by default and can be modified to change the line's color when above/below an indicator value. To save a copy of the indicator open up the NinjaScript Editor> Open the PriceLine file> right click> Save As> give the script a different name.

    Unfortunately, I do not know of an existing indicator that I could provide for an example.

    Please let me know if I can assist any further.

    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the reply Chris, I have made a copy of the Priceline, Essentially I'm just trying to have a SMA, for instance of 700 periods on my line on close tick chart, that changes color depending on if it's above the white line or below, if an image helps at all. I'm not sure. Click image for larger version

Name:	1BUUBzc.png
Views:	78
Size:	46.9 KB
ID:	1137447
      Attached Files

      Comment


        #4
        Hello harryodell55, thanks for your reply.

        Unfortunately, I will not be able to provide a full example of the changes. The new PriceLine script needs to add the EMA/SMA indicator to get price updates from it in OnBarUpdate. When the value of the Close[0] price is above/below the MA value, the indicator needs to use a different brush color, so you will have to set up an extra brush in the script as well. This post will remain open to any member of the community that wishes to help out as well.

        Please let me know if I can assist any further.
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Leeroy_Jenkins, Today, 01:32 AM
        3 responses
        25 views
        0 likes
        Last Post s.kinra
        by s.kinra
         
        Started by MatthewLesko, Yesterday, 07:59 PM
        1 response
        15 views
        0 likes
        Last Post StealthM93  
        Started by RookieKiwi, Yesterday, 06:53 PM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_EricB  
        Started by Skyfly1715, Yesterday, 08:10 PM
        2 responses
        8 views
        0 likes
        Last Post s.kinra
        by s.kinra
         
        Started by max333, Yesterday, 09:05 PM
        0 responses
        8 views
        0 likes
        Last Post max333
        by max333
         
        Working...
        X