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

Plots move when chart scrolls

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

    Plots move when chart scrolls

    I've uploaded two screenshots of the same chart. It seems when I scroll the chart, the plot "moves". The plots are created using PlotStyle.Block. The relevant parts of the code are here -
    if (State == State.SetDefaults)
    ...
    BlockOffset = 3;
    SellBrush = Brushes.Red; // screenshot shows Magenta
    BuyBrush = Brushes.Aqua; // screenshot shows Blue
    AddPlot(new Stroke(Brushes.Transparent, 6), PlotStyle.Block, "MYTarget");

    protected override void OnBarUpdate()
    ...
    PlotBrushes[0][0] = Brushes.Transparent;
    // if sell signal
    MYTarget[0] = High[0] + (BlockOffset * TickSize);
    PlotBrushes[0][0] = SellBrush;
    // or if buy signal
    MYTarget[0] = Low[0] - (BlockOffset * TickSize);
    PlotBrushes[0][0] = BuyBrush;​

    Can anyone tell me why the plot points are moving higher or lower when the screen is scrolled? I checked if Auto-Scale is the issue and that doesn't seem to be it. Thanks for your time.
    Attached Files

    #2
    Hello sobertradingpartner,

    Thank you for your post.

    Please right-click your chart and select indicators. Take a screenshot of the indicator properties for this particular indicator with the plot so I may better understand and assist you.

    I look forward to your reply.
    Emily C.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Emily View Post
      Hello sobertradingpartner,

      Thank you for your post.

      Please right-click your chart and select indicators. Take a screenshot of the indicator properties for this particular indicator with the plot so I may better understand and assist you.

      I look forward to your reply.
      I took some screens from a different instrument. The same issues are happening there also. The properties are the third graphic. Thanks!
      Attached Files

      Comment


        #4
        Hello sobertradingpartner,

        Thank you for your reply.

        I see you have the Scale Justification of the indicator set to "Overlay" which I suspect is causing this behavior. If you change it to "Right" it should share the same scale as the bars which would make it so the plots are adjusted/scaled the same as the bars when you scroll on the chart. For more information about scale justification:
        Please let us know if we may be of further assistance.
        Emily C.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Emily View Post
          Hello sobertradingpartner,

          Thank you for your reply.

          I see you have the Scale Justification of the indicator set to "Overlay" which I suspect is causing this behavior. If you change it to "Right" it should share the same scale as the bars which would make it so the plots are adjusted/scaled the same as the bars when you scroll on the chart. For more information about scale justification:
          Please let us know if we may be of further assistance.
          That fixed the issue. Why is it the issue was not resolved when I chose "Left Justification"? Is it just because the main chart is right justified?

          Comment


            #6
            Originally posted by sobertradingpartner View Post

            That fixed the issue. Why is it the issue was not resolved when I chose "Left Justification"? Is it just because the main chart is right justified?
            Yes, the chart bars have the scale justification set to Right by default. This could also be changed between the options of Right, Left, and Overlay in the Data Series window if desired.

            Please don't hesitate to reach out with any additional questions or concerns.
            Emily C.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Emily View Post

              Yes, the chart bars have the scale justification set to Right by default. This could also be changed between the options of Right, Left, and Overlay in the Data Series window if desired.

              Please don't hesitate to reach out with any additional questions or concerns.
              Thank you!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by fx.practic, 10-15-2013, 12:53 AM
              5 responses
              5,403 views
              0 likes
              Last Post Bidder
              by Bidder
               
              Started by Shai Samuel, 07-02-2022, 02:46 PM
              4 responses
              95 views
              0 likes
              Last Post Bidder
              by Bidder
               
              Started by DJ888, Yesterday, 10:57 PM
              0 responses
              7 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by MacDad, 02-25-2024, 11:48 PM
              7 responses
              159 views
              0 likes
              Last Post loganjarosz123  
              Started by Belfortbucks, Yesterday, 09:29 PM
              0 responses
              8 views
              0 likes
              Last Post Belfortbucks  
              Working...
              X