Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Updating Plot Values on COBC = false

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

    Updating Plot Values on COBC = false

    Hi,

    I am running a chart with COBC = false and updating plot values on each tick.

    Values[i].Set(Math.Min(Values[i][1], Instrument.MasterInstrument.Round2TickSize(Low[0] + keyValue[i])));

    The issue is that the plot is not updating in real time to reflect the values being set. I know I can fix this by refreshing the ChartControl but I would rather not - performance issues. Is this a data binding issue with the plots? Can someone suggest a possible solution? Thank you.

    #2
    Originally posted by Zeos6 View Post
    Hi,

    I am running a chart with COBC = false and updating plot values on each tick.

    Values[i].Set(Math.Min(Values[i][1], Instrument.MasterInstrument.Round2TickSize(Low[0] + keyValue[i])));

    The issue is that the plot is not updating in real time to reflect the values being set. I know I can fix this by refreshing the ChartControl but I would rather not - performance issues. Is this a data binding issue with the plots? Can someone suggest a possible solution? Thank you.
    Without knowing the values that you are getting, you are using a Math.Min() method. I would expect that most of the time, the Plot value would be static. After all. for the Plot to change, the second term would have to be and stay below the previous recorded value from one bar ago. IOW, your Plot is monotonically decreasing or flat.

    Comment


      #3
      Thank you. That is true except that he plot values are not updating in real time. I will check it out.

      Comment


        #4
        Originally posted by Zeos6 View Post
        Thank you. That is true except that he plot values are not updating in real time. I will check it out.
        I think that I may not have explained it properly then, so let my try again.

        The ONLY time that you will see a change in the Plot is if, and only if, the value of Instrument.MasterInstrument.Round2TickSize(Low[0] + keyValue[i] goes and stays below the Plot value on the previous bar.

        Even in realtime, if that aforesaid value dips below the previous value, then goes back above it, the Plot will revert to the capped value. If that dip and jump happens within the chart refresh period, you will not even see that blip.

        Comment


          #5
          Hi koganam,

          I think you hit the nail on the head. That is exactly what is happening. I understand about the monotonic decreasing aspect and that is fine. The issue is that I see the dip, as you say, and if the value rises above the cap value the plot does not change. What I am after is to have the plot reflect the new dip value as soon as the dip takes place. Any suggestions as to how I can achieve this? Any suggestions would be greatly appreciated. Thank you.

          Comment


            #6
            Originally posted by Zeos6 View Post
            Hi koganam,

            I think you hit the nail on the head. That is exactly what is happening. I understand about the monotonic decreasing aspect and that is fine. The issue is that I see the dip, as you say, and if the value rises above the cap value the plot does not change. What I am after is to have the plot reflect the new dip value as soon as the dip takes place. Any suggestions as to how I can achieve this? Any suggestions would be greatly appreciated. Thank you.
            The first thing to do would be to straighten out your logic. Once you do that, translating it into code is no longer a chore. As an aside, you seem to be indexing these values. As I have no knowledge of your indexing scheme, I am only going to show you one way to do it using a single Plot. You will have to handle massaging the method into your code all on your lonesome.

            From what you describe, then, what you really want is to have your Plot be the lower of your delta function, and the previous plot. What that means logically then, is also that your previous plot can only be of use at the start of the bar, not a consistent comparative value. That leads me to this logic:
            1. When a new bar starts, store the value of the Plot for the previous bar.
            2. On each tick, the Plot on the current bar is the least of the current stored value and the current delta function.
            The former teacher in me says that I should leave you to code that, because I believe that you can. If you still need help, holler.

            Comment


              #7
              Hi koganam,

              Funny that you mention this approach. That is exactly the approach I took. I am now using:

              plotTestValue[i] = Math.Min(plotTestValue[i], Instrument.MasterInstrument.Round2TickSize(Low[0] + keyValue[i]));
              Values[i].Set(plotTestValue[i]);

              where on the first tick of each bar I set the plotTestValue as:

              for (int i = 0; i < 6; i++) plotTestValue[i] = Values[i][1];

              I am using this on financial data and can only test it properly when the markets are moving - in other words, later tonight or tomorrow.

              BTW, the indexing simply reflects the fact that I am plotting five plots. First plot is Values[0], and so on.

              Thank you for you help. :-)

              Comment


                #8
                This worked well. Thanks koganam. :-)

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                607 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                353 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                105 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                560 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                561 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X