Announcement

Collapse
No announcement yet.

condition OR

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

  • condition OR

    Hi

    If && means " and " in EFS, what do we use for " or "

    if (a>b OR a>c OR a > d OR a > e)



    Regards

    Rana

  • #2
    Rana
    See the Beginner Tutorial 2: Commonly Used Core JavaScript for a list of the most commonly used operators
    For a complete list see the article on Expressions and Operators in the Core JavaScript Guide (also in the EFS KnowledgeBase)
    Alex


    Originally posted by Rana View Post
    Hi

    If && means " and " in EFS, what do we use for " or "

    if (a>b OR a>c OR a > d OR a > e)



    Regards

    Rana

    Comment


    • #3
      Alex Thank you for referring me to the thread.

      I think if (a>b || a>c || a > d || a > e) will do the trick as per thread. I will try to use it and ask your further help later after reading whole of it.

      One more question if I may ask here is about calculating mid point
      vPP = (vHigh+vLow)/2; This works fine.
      But whenever I try to change this 2 to 3 or 4 or (vHigh+vLow)* 0.33 or(vHigh+vLow)* 0.2 , it stops drawing lines. Anything I am missing here ?

      Regards

      Comment


      • #4
        Rana
        It is likely still drawing them but outside of the visible range of the chart. Just use a debug statement on the result of the calculation and see what value it returns
        Alex


        Originally posted by Rana View Post
        Alex Thank you for referring me to the thread.

        I think if (a>b || a>c || a > d || a > e) will do the trick as per thread. I will try to use it and ask your further help later after reading whole of it.

        One more question if I may ask here is about calculating mid point
        vPP = (vHigh+vLow)/2; This works fine.
        But whenever I try to change this 2 to 3 or 4 or (vHigh+vLow)* 0.33 or(vHigh+vLow)* 0.2 , it stops drawing lines. Anything I am missing here ?

        Regards

        Comment


        • #5
          haha , you are right.
          16200 high and 16000 low. so currently, it draws line at 16100 with (high+low)/2. And when I change it to (high+low)/3, it draws at 10730 which mathematically is correct. I thought it would be drawing somewhere between 16200 high and 16000 low with /3. I somehow managed desired results with vPP = (vHigh -((vHigh-vLow) *0.3)) ; .

          Having said that I do not know what " debug statement " is and how to use it. But anyway I am getting results by correcting the formula.



          Thank you so much.

          Comment


          • #6
            Alex please make my life easier with this too.
            I am using
            drawTextRelative(0, low(inv("d")) , "-" , Color.RGB(0,255,0) , Color.RGB(0,255,0), Text.BOLD | Text.CENTER | Text.TOP, null, 8, "PdLLL"+rawtime(0) ); to draw a line.

            Can you help me change values
            drawLineRelative(x1, y1, x2, y2, Style, Thickness, Color, TagName)
            to draw a line instead of text please.
            I would like to draw a line at the high/low of daily bar.

            Regards

            Comment


            • #7
              Rana

              Having said that I do not know what " debug statement " is and how to use it.
              If you are unfamiliar with programming in EFS it would benefit you if you take some time to learn a bit more about it.
              To this effect I would suggest that you review the JavaScript for EFS videos and the Core JavaScript Reference Guide. Those will provide you with a thorough introduction to programming in JavaScript which is at the foundation of EFS. Then go through the EFS KnowledgeBase and study the Help Guides and Tutorials which will provide you with the specifics of EFS. Also search the forums as they are an invaluable resource in as much as many of the things you are trying to do have been discussed before (and in many cases at length)

              Can you help me change values
              drawLineRelative(x1, y1, x2, y2, Style, Thickness, Color, TagName)
              See this article in the EFS KnowledgeBase on the drawLineRelative() function. Also search the forums as there are literally hundreds of examples of its use
              Alex


              Originally posted by Rana View Post
              haha , you are right.
              16200 high and 16000 low. so currently, it draws line at 16100 with (high+low)/2. And when I change it to (high+low)/3, it draws at 10730 which mathematically is correct. I thought it would be drawing somewhere between 16200 high and 16000 low with /3. I somehow managed desired results with vPP = (vHigh -((vHigh-vLow) *0.3)) ; .

              Having said that I do not know what " debug statement " is and how to use it. But anyway I am getting results by correcting the formula.



              Thank you so much.
              Originally posted by Rana View Post
              Alex please make my life easier with this too.
              I am using
              drawTextRelative(0, low(inv("d")) , "-" , Color.RGB(0,255,0) , Color.RGB(0,255,0), Text.BOLD | Text.CENTER | Text.TOP, null, 8, "PdLLL"+rawtime(0) ); to draw a line.

              Can you help me change values
              drawLineRelative(x1, y1, x2, y2, Style, Thickness, Color, TagName)
              to draw a line instead of text please.
              I would like to draw a line at the high/low of daily bar.

              Regards

              Comment


              • #8
                Many thanks for your help. You been great as always.

                Comment


                • #9
                  Rana
                  You are welcome
                  Alex


                  Originally posted by Rana View Post
                  Many thanks for your help. You been great as always.

                  Comment

                  Working...
                  X