• 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 thgamey, Today, 02:05 AM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_PatrickG  
      Started by yeshujbp, Yesterday, 02:40 PM
      1 response
      11 views
      0 likes
      Last Post NinjaTrader_PaulH  
      Started by sardana, Today, 05:52 AM
      1 response
      3 views
      0 likes
      Last Post NinjaTrader_PaulH  
      Started by Mykro, Yesterday, 04:58 PM
      1 response
      11 views
      0 likes
      Last Post NinjaTrader_PaulH  
      Started by akuntysh, Today, 02:43 AM
      0 responses
      5 views
      0 likes
      Last Post akuntysh  
      Working...
      X