Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Drawning with Time X & Y

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

    Drawning with Time X & Y

    Hi, why does this simple code not work properly?

    if (
    ToTime(Time[0]) == ToTime(21, 30, 0)
    )

    {
    timp = Close[0];
    DrawLine("wv1" + CurrentBar, false, Time[0].AddMinutes(515), timp, Time[0].AddMinutes(1470), timp, Color.Green, DashStyle.Solid, 2);
    }

    I want the line drawed the next day, if i backtest it in the strategy analyzer it's corret most of days but in some it just plots a small dot in at the beginnig of the line and nothing else until the end of the day, any suggestoins?

    Thanks,

    Alex

    #2
    alext,

    Thank you for your post.

    I'm not sure I am seeing the same results as you are experiencing - would you be able to attach a screen shot to your next post with a chart with issues?
    MatthewNinjaTrader Product Management

    Comment


      #3
      Sure, please note the small dot at the beginning of the day where the line isnt plotted.

      Alex
      Attached Files

      Comment


        #4
        alext,

        Thanks for the screen shots.

        The dots you are seeing are due to the session breaks in the session template where there is no data (I.e., over the weekend or a holiday).

        To avoid this, you may want to use if Bars.FirstBarOfSession rather than a specific time:

        MatthewNinjaTrader Product Management

        Comment


          #5
          Thank you Matthew, i dindt thinked about it.
          Like this seems to work fine:

          if (
          Bars.FirstBarOfSession
          )

          {
          DrawLine("wv1" + CurrentBar, true, Time[0], timp, Time[0].AddMinutes(1395), timp, Color.Green, DashStyle.Solid, 2);
          }

          Regards,

          Alex

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Rogers101, 05-05-2024, 11:30 AM
          10 responses
          33 views
          0 likes
          Last Post Rogers101  
          Started by tradingnasdaqprueba, Today, 03:42 AM
          2 responses
          21 views
          0 likes
          Last Post tradingnasdaqprueba  
          Started by cmtjoancolmenero, 04-25-2024, 03:58 PM
          21 responses
          114 views
          0 likes
          Last Post cmtjoancolmenero  
          Started by Quanto, 04-17-2024, 10:43 AM
          3 responses
          28 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by Mindset, Yesterday, 06:19 AM
          3 responses
          17 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X