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 AaronKoRn, Today, 09:49 PM
                  0 responses
                  5 views
                  0 likes
                  Last Post AaronKoRn  
                  Started by carnitron, Today, 08:42 PM
                  0 responses
                  8 views
                  0 likes
                  Last Post carnitron  
                  Started by strategist007, Today, 07:51 PM
                  0 responses
                  9 views
                  0 likes
                  Last Post strategist007  
                  Started by StockTrader88, 03-06-2021, 08:58 AM
                  44 responses
                  3,975 views
                  3 likes
                  Last Post jhudas88  
                  Started by rbeckmann05, Today, 06:48 PM
                  0 responses
                  9 views
                  0 likes
                  Last Post rbeckmann05  
                  Working...
                  X