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

Cannot get Close[0] > to work on historical end of day data

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

    #16
    Hello RMnon-programmer,

    Thank you for your response.

    Let's try to clear things up here. Can you provide in detail what you want to see? Not what is occurring, but what you would like to see.

    Comment


      #17
      Very simply, to repeat my earlier summary, IF "the close one day from the current day is greater than the close PERIOD over the last 5 days from today's current close", go long.

      Comment


        #18
        Thanks, I believe you are looking for the following:
        Code:
        			if(Close[1] > Close[2]
        				&& Close[1] > Close[3]
        				&& Close[1] > Close[4]
        				&& Close[1] > Close[5])
        			{
        				// do something
        			}

        Comment


          #19
          Thank you for this response, that is basically what I am looking for in the way of code. The only problem is I do not know how to limit the results to the current full end of day market close date (i.e. when the market closes today, that date would be September 1) and AT MOST the preceding days necessary to satisfy all of the criteria. In other words, the results printed can go back weeks or even months and even though all criteria may be satisfied, the "current close day close[0] " is NOT today's market close date. So I don't want to print those old results.

          I don't know how else to explain it.

          Thanks for all of your help.

          Comment


            #20
            That will be processed as each day is a new day in historical processing. So the code will hold.

            Comment


              #21
              Hello RMnon-programmer,

              Thank you for your response.

              You could check the timestamp of the bar to the system time, such as the following:
              Code:
              if(Time[0].Day == DateTime.Now.Day)

              Comment


                #22
                Hello RMnon-programmer,

                Thank you for your response.

                You could check the timestamp of the bar to the system time, such as the following:
                Code:
                if(Time[0].Day == DateTime.Now.Day)
                Thanks, this gives me something to work on to exclude past/historical results from the output.

                Comment


                  #23
                  Originally posted by RMnon-programmer View Post
                  Thanks, this gives me something to work on to exclude past/historical results from the output.
                  http://ninjatrader.com/support/helpG...historical.htm

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Tin34, Today, 03:30 AM
                  2 responses
                  15 views
                  0 likes
                  Last Post Tin34
                  by Tin34
                   
                  Started by sastrades, Yesterday, 09:59 AM
                  2 responses
                  28 views
                  0 likes
                  Last Post brucerobinson  
                  Started by ETFVoyageur, Today, 12:52 AM
                  1 response
                  14 views
                  0 likes
                  Last Post Leeroy_Jenkins  
                  Started by lollers, Today, 03:26 AM
                  0 responses
                  10 views
                  0 likes
                  Last Post lollers
                  by lollers
                   
                  Started by aliyahany, Today, 03:16 AM
                  0 responses
                  2 views
                  0 likes
                  Last Post aliyahany  
                  Working...
                  X