Announcement

Collapse
No announcement yet.

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 charlesugo_1, 05-26-2026, 05:03 PM
                  0 responses
                  65 views
                  0 likes
                  Last Post charlesugo_1  
                  Started by DannyP96, 05-18-2026, 02:38 PM
                  1 response
                  149 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by CarlTrading, 05-11-2026, 05:56 AM
                  0 responses
                  162 views
                  0 likes
                  Last Post CarlTrading  
                  Started by CarlTrading, 05-10-2026, 08:12 PM
                  0 responses
                  99 views
                  0 likes
                  Last Post CarlTrading  
                  Started by Hwop38, 05-04-2026, 07:02 PM
                  0 responses
                  286 views
                  0 likes
                  Last Post Hwop38
                  by Hwop38
                   
                  Working...
                  X