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

limit a study to 2 days, today and yesterday

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

    limit a study to 2 days, today and yesterday

    How do I limit a study so that it only shows on today and yesterday chart only.

    #2
    You can work with ToDay() for this check - http://www.ninjatrader-support.com/H...eV6/ToDay.html
    BertrandNinjaTrader Customer Service

    Comment


      #3
      thanks,

      I have;

      if (Bars.GetSessionBar(1) != null) // yesterday processing
      { check yesterday data, draw an arrow at 4:15 PM }

      if (Bars.GetSessionBar(0) != null) // today processing
      { check today data, draw an arrow at 9:30 AM }


      and it should be no arrow for any other day but arrows shows up on all of the days I load.

      Comment


        #4
        nkhoi,

        That would not work. Processing of data goes from the very oldest to the very newest. As each new day is processed you have a keep rolling forward and your conditions are true for every single day moving forward. The only way you can limit it to the last two days is if you knew definite dates for the last two days you want to process and limit it that way with DateTime checks.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          you manual is terrible there is no example for getting today date or yesterday date, a search on key word yesterday or prior day return zero hit. But you also have a cs file that shows some related example that just enough to keep me going so thanks. I upload 2 versions of open range with overnight session, one plots continuously and one doesn't in case anybody interests.

          Comment


            #6
            Thanks for the feeback and the sharing of those scripts, for today you can just use DateTime.Today, for yesterday's substract one then.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Bertrand View Post
              Thanks for the feeback and the sharing of those scripts, for today you can just use DateTime.Today, for yesterday's substract one then.
              that was what I found out but I didn't get your answer until now.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by fx.practic, 10-15-2013, 12:53 AM
              5 responses
              5,404 views
              0 likes
              Last Post Bidder
              by Bidder
               
              Started by Shai Samuel, 07-02-2022, 02:46 PM
              4 responses
              95 views
              0 likes
              Last Post Bidder
              by Bidder
               
              Started by DJ888, Yesterday, 10:57 PM
              0 responses
              8 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by MacDad, 02-25-2024, 11:48 PM
              7 responses
              160 views
              0 likes
              Last Post loganjarosz123  
              Started by Belfortbucks, Yesterday, 09:29 PM
              0 responses
              9 views
              0 likes
              Last Post Belfortbucks  
              Working...
              X