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 sjsj2732, Yesterday, 04:31 AM
          0 responses
          38 views
          0 likes
          Last Post sjsj2732  
          Started by NullPointStrategies, 03-13-2026, 05:17 AM
          0 responses
          287 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          288 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          134 views
          1 like
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          95 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Working...
          X