• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Prevent plotting session jumps

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

    Prevent plotting session jumps

    Hi,

    I was wondering how I would be able to prevent an overlay indicator line to draw between sessions. So right now I have a line that jumps between sessions. I would be nicer if it just ends end the end of a session and then draws a new line at the beginning of a new session. In stead of trying to continue drawing which makes the session-breaks jump the line vertically.

    Thanks.

    #2
    siroki, are those plots currently? Then for example you could look into changing the style to a dot or hash that would not be connecting the segments, like a line or square style would in contrast.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Just set the color for the first bar of the session to transparent, if the plot style is line or square. Here is are some line applied to the first plot Plots[0].

      Code:
      #region Variables
            .....
            private bool drawGap = false;
            .....
      #endregion
      
      protected override void OnStartUp()
      {
                 .....
                 drawGap = (Plots[0].PlotStyle == PlotStyle.Line) || (Plots[0].PlotStyle == PlotStyle.Square);
      }
      
      protected override void OnBarUpdate()
      {
                 .....
                 if (drawGap & Bars.FirstBarOfSession)
                             PlotColors[0][0] = Color.Transparent; 
      }

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by pvtrader, Today, 09:51 AM
      3 responses
      11 views
      0 likes
      Last Post pvtrader  
      Started by hincal, Today, 10:07 AM
      0 responses
      3 views
      0 likes
      Last Post hincal
      by hincal
       
      Started by shawn9876, Today, 09:07 AM
      0 responses
      8 views
      0 likes
      Last Post shawn9876  
      Started by andreslazor7, Today, 08:28 AM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_Zachary  
      Started by kedrykvander, Today, 08:19 AM
      2 responses
      14 views
      0 likes
      Last Post kedrykvander  
      Working...
      X