Announcement

Collapse
No announcement yet.

Range bar analysis ...

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

  • Range bar analysis ...

    How about the famous NR7 and the IDNR4. Is there an EFS for that? I would want the NR7 to have a pink diamond shape on top of the bar and the IDNR4 to have a blue circle on the bottom of the bar...

    From mestastock NR7:
    HIGH-LOW<Ref(LLV(H-L,6),-1)

    From mestastock IDNR4:
    HIGH-LOW<Ref(LLV(H-L,3),-1) AND
    HIGH<= Ref(HIGH,-1)
    AND LOW>= Ref(LOW,-1)

  • #2
    I am interested in this too. Is it possible in eSignal?
    Tom

    Comment


    • #3
      I wil try to help...

      Please explain what LLV stands for and I will conver this code for you. I think is means "LowestLowVariable", but I'm not sure..

      Brad
      Brad Matheny
      eSignal Solution Provider since 2000

      Comment


      • #4
        I did not post the Metastock code, but that is what it means. An NR7 day means that todays range is smaller than smallest range of the preceding 6 days, i.e. today's range is the narrowest range of 7 days.
        Would your code work for intraday charts as well, so as to be able to flag 15-minute or 60-minute NR7 bars as well?
        Tom

        Comment


        • #5
          Here you go...

          This should be what you want - graphics and all..

          Brad
          Attached Files
          Brad Matheny
          eSignal Solution Provider since 2000

          Comment


          • #6
            Minor Graphics issue...

            Here is a revised piece of code. I forgot to align the graphics, so this one works the way it should..

            Brad
            Attached Files
            Brad Matheny
            eSignal Solution Provider since 2000

            Comment


            • #7
              It looks good to me!

              Just one question: Is it possible to make the two colors variables so that they can be customized if we click on "Edit Studies"?
              Tom

              Comment


              • #8
                Hi Brad,

                You can add this code to main() to get the color variables as inputs.

                PHP Code:
                function main(nColor) {
                    if (
                nColor == null) {
                        
                nColor Color.black;
                    } else {
                        
                nColor = eval("Color."+nColor);
                    }
                    
                /**** Valid inputs for nColor ******
                    aqua, black, blue, brown, cyan, darkgreen,
                    darkgrey, fushcia, green, grey, khaki,
                    lightgrey, lightyellow, lime, magenta,
                    maroon, navy, olive, paleyellow, purple,
                    red, teal, white, yellow
                    ***********************************/ 
                Jason K.
                Project Manager
                eSignal - an Interactive Data company

                EFS KnowledgeBase
                JavaScript for EFS Video Series
                EFS Beginner Tutorial Series
                EFS Glossary
                Custom EFS Development Policy

                New User Orientation

                Comment


                • #9
                  Thanks Jason...

                  Thanks Jason. I was wondering about the color issue. Maybe you can explain where the eval function is also of use??

                  Brad
                  Brad Matheny
                  eSignal Solution Provider since 2000

                  Comment


                  • #10
                    By the way, are you aware that others won't be able to search for this EFS using the search term "NR7"? The search engine on this Bulletin Board comes back with error message:


                    The search term you specified (nr7) is under the minimum word length (4) and therefore will not be found. Please make this term longer.
                    If this term contains a wildcard, please make this term more specific.


                    It also won't allow a search on the word "low", which has to be a common search term for a forum like this.
                    Tom

                    Comment


                    • #11
                      Hello Brad,

                      Here is some detailed info on eval(). Basically, it converts a string to the expression it represents. For example, let's say we build this string: "2*2" and set a variable equal to that.

                      var vData = "2*2"

                      debugPrintln(vData) would print: 2*2
                      debugPrintln(eval(vData)) would print: 4

                      eval() evaluates the string and converts it to what ever it is. In this case the string evaluates to a math statement so it converts it to such and does the math. The string you pass to eval() can also represent an object like the Color object in the code I gave you. It is most useful in EFS when setting variables equal to user inputs from the "Edit Studies" option, because text is sent as a string. For the string: "Color." + nColor, eval() converts it to the Color object with the user defined color value stored in our nColor variable. I hope you find this useful.

                      Cheers,
                      Jason K.
                      Project Manager
                      eSignal - an Interactive Data company

                      EFS KnowledgeBase
                      JavaScript for EFS Video Series
                      EFS Beginner Tutorial Series
                      EFS Glossary
                      Custom EFS Development Policy

                      New User Orientation

                      Comment

                      Working...
                      X