Announcement

Collapse
No announcement yet.

numBars

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

  • numBars

    Simple question. If I say if close(0,-10) > X then Y, does that mean if in ANY ONE of the last 10 bars the close is greater than X then Y is true?

  • #2
    Simple answer, no.

    I believe what you are describing is more pseudo code, which could be unique to a platform you may be using.

    You can code this yourself using a simple 'for loop' in javaScript or use one of the Donchian Channels functions in your if conditional statement to accomplish what you are looking for. Alternately, you could create a distinct stand alone function in your efs to do that as well.

    for example:

    if (upperDonchian(10)>X){
    //do something here...
    }


    I believe that would do what you want...

    Comment


    • #3
      numBars

      Sorry, perhaps I wasn't clear. I'm just asking for clarification on the efs definition of "close()." According to the eSignal EFS Deveoper's Reference the parameters for close are close(barIndex,numBars,...etc). My question is about the term numBars. For example in the code "if ( close(0,-10) > 100 ) " something happens, does that mean that if any one of the bars going 10 back reaches above 100 "something happens?" Let's say the seventh bar back is above 100 but all the rest were below, does "something happen?"

      Comment


      • #4
        marvslater

        Let's say the seventh bar back is above 100 but all the rest were below, does "something happen?"
        As Steve has already indicated nothing happens. The parameter numBars only serves to create an array of "numBars" elements but that does not implicitly mean that you are checking X against each element in that array. To do that you need to use a Loop Statement as Steve suggested (see the link for information on Loop Statements)
        Alex

        Comment


        • #5
          numBars

          Well, obviously I'm a lousy programmer and don't know how to use arrays but this points out another problem I have. When I click on the link you provided I get a blank page. For some reason I am blocked out of viewing EFS Knowledge Base or else I would be reading that to get my answers instead of bothering people on the Bulletin Board with basics. I have told several people including tech support that whenever I click on a link to EFS Knowledge Base I every time before it took me to eSignal Knowledge Base. With the link you sent I get a blank page. No one has been able to tell me how to fix it. Bottom line I don't have any way to look up arrays.

          Comment


          • #6
            marvslater
            FWIW in the enclosed animated image you can see what happens at my end when I click the link (I have tried this on three different computers). You may want to check the settings on your browser.
            Alex

            Comment

            Working...
            X