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

Previous Close

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

    Previous Close

    I took the PriorDay OHLC and modified it to only show the close.

    Now I would like it to only show the previous day only no history.

    It is probably a simple line to fix but it beats me I dont know how

    Thank you for your help as I am relatively new to programming.
    Attached Files

    #2
    richbois, you would need to include a check for the date then before plotting your calculated values -

    Code:
    ... && if (ToDay(DateTime.Today) == ToDay(Time[0].Date))

    Last edited by NinjaTrader_Bertrand; 01-13-2010, 06:34 AM.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      richbois, you would need to include a check for the date then before plotting your calculated values -

      Code:
      ... && if (ToDay(DateTime.Today) != ToDay(Time[0].Date))

      Thank you Bertrand but I tried to add that line on just about every line of code and all I get is errors

      Can you narrow it down a bit please

      Comment


        #4
        richbois,

        Please provide the error message you are seeing. Thank you.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Josh View Post
          richbois,

          Please provide the error message you are seeing. Thank you.
          This is what I get on all the lines I tried to add the text in previous post

          Again thanks for your help
          Attached Files
          Last edited by richbois; 01-11-2010, 04:11 PM.

          Comment


            #6
            Remove the ) before the && in your line of code. You already closed the if-statement with that ).
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Josh View Post
              Remove the ) before the && in your line of code. You already closed the if-statement with that ).
              I did that and also removed the second IF and i dont have any compilling errors anymore, however it didnt solve the original problems.

              any other ideas ??????

              Comment


                #8
                richbois, sorry for a mixup in my prior reply you would need to add this before setting your PriorClose dataseries -

                Code:
                 
                if (ShowClose && ToDay(DateTime.Today) == ToDay(Time[0].Date)) PriorClose.Set(priordayClose);
                This would then only show the Plots for the current day.
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  thank you gents for your help that did it

                  Have a great day

                  Comment


                    #10
                    Using PriorDayOHLC().PriorLow[0]

                    Really simple one this... but I still need help with it:

                    PriorDayOHLC().PriorLow[0] = prior day Low

                    But I want to extract the Low of 2 days ago.... (Prior day -1)

                    Ideas?


                    Regards

                    Comment


                      #11
                      everington_f, you would need to work with a combination of GetBar and the PriorDayOHLC to be able to access this info, as there's unfortunately no daysAgo input, but a barsAgo one that you can use to arrive at it.
                      BertrandNinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Javierw.ok, Today, 04:12 PM
                      0 responses
                      2 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
                      40 views
                      0 likes
                      Last Post alifarahani  
                      Started by Waxavi, Today, 02:10 AM
                      1 response
                      18 views
                      0 likes
                      Last Post NinjaTrader_LuisH  
                      Started by Kaledus, Today, 01:29 PM
                      5 responses
                      15 views
                      0 likes
                      Last Post NinjaTrader_Jesse  
                      Working...
                      X