Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

On Date x do this

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

    On Date x do this

    hi all

    I wrote this line of code
    if (ToDay(Time[0]) > 20110212) return;

    therefore the script should stop running

    it does stop running on chart that have less than 4 days of data but continues on charts that have more than 4 days

    today is the 16 of feb 2011

    any ideas?????

    thanks in advance

    #2
    Hello richbois,

    That will look at each bar's date, and then not process any logic if the day integer portion of the date is beyond 20110212.

    Let us know what you are seeing happen exactly and what you expect to happen. That line of code will not exit positions, for example.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Hi Ryan Thank you for pronpt response

      i am creating an indicator that i want to expire and not be usable after date X

      it will print a message on my chart and then return

      this line was added at the beginning of the section OnBar Update

      Comment


        #4
        I see. Thanks for the reply. In this case it may be better to read from the computer system clock rather than the bar's time stamp. If you're using the bar's time stamp then your indicator function historically for all bars prior to the specified date.

        The system clock can be read with DateTime.Now and you can use the NinjaScript method ToDay with it as well.

        If you are interested in distributing your indicators commericially, we have a vendor licensing program for qualified partners This includes time based expiration for your scripts. Please contact [email protected] to discuss setting this up.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          thank you Ryan I will contact Sales

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          576 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          334 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          553 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          551 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X