• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

priorClosePrice question

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

    priorClosePrice question

    I have this on my script trying to get yesterday,s close and day before yesterday close.
    But priorClosePrice and priorClosePrice1 have the same value, are equal.
    Any clue?

    if (BarsInProgress == 0)
    {
    priorClosePrice = PriorDayOHLC().PriorClose[0];
    priorClosePrice1 = PriorDayOHLC().PriorClose[1];
    }

    #2
    Hello,

    Thank you for the post.

    Out of context I would not be certain what could cause the same value, are you able to apply the PriorDayOHLC to the instrument in a chart and see the PriorClose plot changing?

    If so could you provide more details on the instrument used and the timeframes you are using?

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      I will work on it but first let me understand it clearer.

      Does PriorDayOHLC().PriorClose[0]; returns yesterday close price?
      And PriorDayOHLC().PriorClose[10]; would be the close price of 10 days ago?

      Comment


        #4
        Hello,

        This should return the value as you are asking, again I would be unsure out of context what may be occurring. Have you tried a simple test like the following?

        Code:
        protected override void OnBarUpdate()
        {
        	if(CurrentBar < 1)return;
          	Print(PriorDayOHLC()[0] +  "  " + PriorDayOHLC().PriorClose[1]);
        }
        I tried this on a ES minute chart and see the output like the following:


        2184 2205.25
        Could you provide the specifics of the test you are trying along with the syntax being used?


        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Captain_Qwark, Today, 10:55 AM
        3 responses
        18 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by kmpc1, Today, 11:03 AM
        1 response
        13 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Started by jransom, Today, 09:08 AM
        1 response
        18 views
        0 likes
        Last Post NinjaTrader_Kate  
        Started by mtamaku, Today, 09:19 AM
        0 responses
        23 views
        0 likes
        Last Post mtamaku
        by mtamaku
         
        Started by traderMNQ, Today, 09:00 AM
        4 responses
        20 views
        0 likes
        Last Post traderMNQ  
        Working...
        X