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 lorem, Yesterday, 09:18 AM
        5 responses
        16 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by Spiderbird, Today, 12:15 PM
        0 responses
        5 views
        0 likes
        Last Post Spiderbird  
        Started by cmtjoancolmenero, Yesterday, 03:58 PM
        12 responses
        42 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by FrazMann, Today, 11:21 AM
        0 responses
        6 views
        0 likes
        Last Post FrazMann  
        Started by geddyisodin, Yesterday, 05:20 AM
        8 responses
        52 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X