Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Displacement is off

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

    Displacement is off

    Good Morning,

    In a strategy Displacement is off by aprox 4 bars.

    In the State.SetDefaults I have displacement set as:

    Code:
    MidPrd	= 26;
    
    Displacement = MidPrd;
    (See attached image)

    To compare the actual values with the strange displacement issues I drew lines where it should be with the following code:

    Code:
    Draw.Line(this,"Line"+CurrentBar.ToString(),-MidPrd,SpanA[0],-MidPrd,SpanB[0],Brushes.Blue);
    Strange, but on bar 0 it offsets multiple times.

    Cheers,

    Sody
    Attached Files

    #2
    Hello SodyTexas,

    Thank you for bringing this to our attention.

    I am not able to reproduce with my own code as you can see in my attached screenshot.

    May I test your indicator on my end? Can you also provide the Calculate used (On Price Change, On Each Tick, or On Bar Close)?
    Attached Files

    Comment


      #3
      Displacement

      Strange, After shutting down and restarting NT8(Beta) the exact code works now.

      But just in case, per your request is the attached indicator. I plan on sharing this indicator anyways once I am allow too, so I see no reason I can't let you take a look.

      Cheers,

      SodyTexas
      Attached Files

      Comment


        #4
        Hello SodyTexas,

        Thank you providing the file to test.

        I will investigate on my end to see if I can reproduce.

        Comment


          #5
          Originally posted by SodyTexas View Post
          Strange, After shutting down and restarting NT8(Beta) the exact code works now.

          But just in case, per your request is the attached indicator. I plan on sharing this indicator anyways once I am allow too, so I see no reason I can't let you take a look.

          Cheers,

          SodyTexas
          You mean that I no longer have to do all my fancy "graphics path" abracadabra in order to displace a plot into the future? I just use Displace, and done?

          Comment


            #6
            Originally posted by koganam View Post
            You mean that I no longer have to do all my fancy "graphics path" abracadabra in order to displace a plot into the future? I just use Displace, and done?
            Not certain exactly which abracada you were using, there were a handful of issues around displacement - however there was one definite change in NT8:

            Previously you may have used DataSeries.ContainsValue() which was reflective of Displacement, however Displacement should now only have a role on rendering the plot. The reimplemented Series<T>.IsValidDataPoint() would not consider displacement. The series value will be whatever value was assigned to the currentbar and not offset by any degree.

            If you're simply looking to visualize a current bars plot +/- n bars, then that is the only effect that Displacement will have.
            MatthewNinjaTrader Product Management

            Comment


              #7
              Originally posted by NinjaTrader_Matthew View Post
              Not certain exactly which abracada you were using, there were a handful of issues around displacement - however there was one definite change in NT8:

              Previously you may have used DataSeries.ContainsValue() which was reflective of Displacement, however Displacement should now only have a role on rendering the plot. The reimplemented Series<T>.IsValidDataPoint() would not consider displacement. The series value will be whatever value was assigned to the currentbar and not offset by any degree.

              If you're simply looking to visualize a current bars plot +/- n bars, then that is the only effect that Displacement will have.
              Try displacing a Plot into the future on NT7, and you will see the Plot cut off on the last bar on the chart and nothing beyond that.

              In NT7, to Plot into the future requires a Custom Plot, that requires us to set up a GraphicsPath and use DrawPath() to draw said path into the area beyond the right most bar on the chart. That is some deep C# grahics abracadabra.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Segwin, 05-07-2018, 02:15 PM
              14 responses
              1,789 views
              0 likes
              Last Post aligator  
              Started by Jimmyk, 01-26-2018, 05:19 AM
              6 responses
              837 views
              0 likes
              Last Post emuns
              by emuns
               
              Started by jxs_xrj, 01-12-2020, 09:49 AM
              6 responses
              3,294 views
              1 like
              Last Post jgualdronc  
              Started by Touch-Ups, Today, 10:36 AM
              0 responses
              13 views
              0 likes
              Last Post Touch-Ups  
              Started by geddyisodin, 04-25-2024, 05:20 AM
              11 responses
              63 views
              0 likes
              Last Post halgo_boulder  
              Working...
              X