• 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 cirzonorkecv, Yesterday, 11:52 PM
      0 responses
      1 view
      0 likes
      Last Post cirzonorkecv  
      Started by rickyblah12, Yesterday, 01:01 PM
      1 response
      12 views
      0 likes
      Last Post Erwin Beckers  
      Started by dadarara, Yesterday, 12:18 PM
      0 responses
      8 views
      0 likes
      Last Post dadarara  
      Started by joemiller, Yesterday, 07:33 AM
      2 responses
      12 views
      0 likes
      Last Post joemiller  
      Started by TheGameOfProbabilities, 07-18-2019, 06:56 AM
      7 responses
      38 views
      0 likes
      Last Post DaveS
      by DaveS
       
      Working...
      X