Announcement

Collapse
No announcement yet.

Most recent down bars

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

  • Most recent down bars

    I'm trying to figure out how to access the price bar info for the previous x number of bars for down bars only. In other words, skipping any up bars.

    Any help/suggestions would be appreciated.

    Steve

  • #2
    try:
    PHP Code:
    for(i=0;i<xNoOfBars;i++){
        if(
    close(-i) < open(-1)){//if -i bar is a down bar, then...
            //...your code here
        
    }

    Wayne
    Last edited by waynecd; 02-01-2012, 04:14 AM.

    Comment


    • #3
      Wayne,

      Thanks so much!

      Steve

      Comment


      • #4
        Previous Bar info

        I accidently posted this question in the new studies forum and got a helpful response from Waynecd, but I still can't figure this out.

        What I am trying to do is compare the range of a down bar (high - low) to the range of the eight previous individual down bars. (Same can be done on the up bar side as well). In other words, how do I pull the high and low info for each of the eight previous down bars so that I can compare them with the current down bar's range.

        The challenge for me is that there is no way of knowing at which bar count back these down bars are going to occur.

        Waynecd gave me a for loop, but I just couldn't figure it out.

        Any help/suggestions are appreciated, and thanks again Wayne.

        Comment


        • #5
          Okay, just in case anybody reads this, I figured it out using myArray with pop and unshift.

          Steve

          Comment

          Working...
          X