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

Updating Plot

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

    Updating Plot

    Don't want to wear out my welcome but I have one more issue and I will stop for the week.

    Moving average that has a color based on the angle. The display is updated on a change in price.

    If the angle causes a down color of red and later in the bar price increases to cause a steeper angle and thus a color of green, the red line between the last bar and the current bar remains along with the now steeper line that is green (and a gray (flat color) in between).

    There must be a way to erase the now incorrect color portion but I can't find any examples.

    I have attached a pic showing exactly what I mean.

    Hints?
    Attached Files

    #2
    Hello,

    Thank you for the post.

    Seeing the residual plot like you have pictured would be unexpected, I wanted to see if you have an example that demonstrates the syntax used to see this?
    If you are using multiple plots potentially this could be expected if the value was not reset or set to the same value as the other plot, if you are using one plot I would not expect this.


    If you could upload a sample of the syntax required along with the steps you used to see this we could further review what may be happening there.


    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks Jesse,

      I have attached the indicator here. To reproduce, you need live data changing the value of the moving average/angle. If the value changes enough to change the color while a bar is still building, you will see the residual color from the old data which stays even when the next bar opens. I am using this on a 4 range chart but have seen the behavior on other charts as well. To test, use small values for angle1 and angle2, like 5 and 30.

      Thanks again.
      Last edited by Trader_Mark; 08-10-2017, 01:30 PM.

      Comment


        #4
        Jesse,

        Still messing with this but curious if you had time to look over code for any glaring errors?

        Thanks,
        Mark

        Comment


          #5
          I haven't looked at the code but the picture seems to clearly show multiple plot problems in NT6.5 code that must have been converted to NT8. You would need to use one plot for the line and just change the plot color according to the angle.
          eDanny
          NinjaTrader Ecosystem Vendor - Integrity Traders

          Comment


            #6
            Hello,

            Thank you for providing the file.

            After further review, It looks like this is one of the items I previously noted or using multiple plots. In this case, this could be expected, the plots would be a result of the logic being used.

            eDanny provided the correct answer, it would be easier to create a single plot and then color only that plot based on your logic. As it is currently it looks like you have multiple plots and in some cases when one is not set, it leaves the line as you see it. A single plot would not have this problem as you would not need to ensure the plots values are exactly the same.

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #7
              Thank you both. I have done as Danny suggested and not only is the code working now, it is a lot cleaner!

              Thanks again.
              Mark

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by mmckinnm, Today, 01:34 PM
              0 responses
              1 view
              0 likes
              Last Post mmckinnm  
              Started by f.saeidi, Today, 01:32 PM
              0 responses
              1 view
              0 likes
              Last Post f.saeidi  
              Started by traderqz, Today, 12:06 AM
              9 responses
              16 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by kevinenergy, 02-17-2023, 12:42 PM
              117 responses
              2,766 views
              1 like
              Last Post jculp
              by jculp
               
              Started by Mongo, Today, 11:05 AM
              5 responses
              15 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Working...
              X