• 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 saltminer, Today, 06:11 PM
        0 responses
        2 views
        0 likes
        Last Post saltminer  
        Started by epitoma, Today, 05:21 PM
        1 response
        15 views
        0 likes
        Last Post NinjaTrader_ShawnB  
        Started by BatBart, Today, 01:24 PM
        1 response
        22 views
        0 likes
        Last Post NinjaTrader_Melissa  
        Started by ezrakoper, Today, 03:05 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by asmmbillah, Today, 02:23 PM
        1 response
        18 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X