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

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 bmartz, 03-12-2024, 06:12 AM
        4 responses
        31 views
        0 likes
        Last Post bmartz
        by bmartz
         
        Started by Aviram Y, Today, 05:29 AM
        4 responses
        12 views
        0 likes
        Last Post Aviram Y  
        Started by algospoke, 04-17-2024, 06:40 PM
        3 responses
        28 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by gentlebenthebear, Today, 01:30 AM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by cls71, Today, 04:45 AM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X