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 Belfortbucks, Today, 09:29 PM
              0 responses
              3 views
              0 likes
              Last Post Belfortbucks  
              Started by zstheorist, Today, 07:52 PM
              0 responses
              7 views
              0 likes
              Last Post zstheorist  
              Started by pmachiraju, 11-01-2023, 04:46 AM
              8 responses
              150 views
              0 likes
              Last Post rehmans
              by rehmans
               
              Started by mattbsea, Today, 05:44 PM
              0 responses
              6 views
              0 likes
              Last Post mattbsea  
              Started by RideMe, 04-07-2024, 04:54 PM
              6 responses
              33 views
              0 likes
              Last Post RideMe
              by RideMe
               
              Working...
              X