Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 DJ888, 04-16-2024, 06:09 PM
          6 responses
          18 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by Jon17, Today, 04:33 PM
          0 responses
          1 view
          0 likes
          Last Post Jon17
          by Jon17
           
          Started by Javierw.ok, Today, 04:12 PM
          0 responses
          6 views
          0 likes
          Last Post Javierw.ok  
          Started by timmbbo, Today, 08:59 AM
          2 responses
          10 views
          0 likes
          Last Post bltdavid  
          Started by alifarahani, Today, 09:40 AM
          6 responses
          41 views
          0 likes
          Last Post alifarahani  
          Working...
          X