Announcement

Collapse
No announcement yet.

2005 Feb: The Truth About Volatility

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

  • #46
    This is just to show the correct long colour change. You can see that the close is above the green (albeit still below the khaki) yet correctly turns blue.
    Attached Files

    Comment


    • #47
      I've tried this edit. Deleted the "else" to "if" - Seems to work.
      Attached Files

      Comment


      • #48
        Doesn't work. 2 answers!

        Needs to be; if red bar & close >entry line = blue

        or if blue bar & close < exit line = red.

        Can you add an additional first question, i.e. if red bar do this, if blue bar do that. I guess the efs only computes on the close, unaware of present red or blue bar.

        Comment


        • #49
          James 88

          So the formula is favouring the long side.
          I am not familiar with the article and do not have access to it but based on what Jason indicated in this post earlier in this same thread the strategy was originally intended only for long trades. In that same post you should also find a version of the same script for short trades.
          Having said that if what you are trying to do is to color the bars blue when prices cross over the Entry line and in red when they cross under the Exit line then you would need to replace the following section of your code



          with the following.



          Once you implement these changes you should get the results you are looking for (see screenshot enclosed below)
          Hope this helps
          Alex

          Comment


          • #50
            Thank you very much indeed.

            James
            Attached Files
            Last edited by James 88; 11-16-2007, 06:16 AM.

            Comment


            • #51
              James
              You are most welcome
              Alex


              Originally posted by James 88
              Thank you very much indeed.

              James

              Comment


              • #52
                Hi Alex

                How can I select "alerts" on/off in edit studies. (I've tried to understand the tutorials but became a little confused.)

                Kind Rgds

                James

                Comment


                • #53
                  this is the study I'm trying to modify the alerts to on/off
                  Attached Files

                  Comment


                  • #54
                    James
                    In the preMain function add a BOOLEAN type FunctionParameter and set it to default to true or false as you prefer eg
                    PHP Code:
                    var fpx = new FunctionParameter("function_parameter_name"FunctionParameter.BOOLEAN)
                    fpx.setDefault(true/false); 
                    For the complete syntax required by the FunctionParameter Object together with examples of its use see the link to the article in the EFS KnowloedgeBase. You can also find examples on how to use the FunctionParameter Object in all the scripts provided in the EFS2 Custom folder in Formulas.
                    Then add to the list of arguments of the main() function the name you have assigned to the FunctionParameter
                    Lastly change the condition in line 63 from
                    PHP Code:
                    if(vColor1!=vColor2){ 
                    to the following
                    PHP Code:
                    if(vColor1!=vColor2&&function_parameter_name==true){ 
                    where function_parameter_name is the name you have assigned to the FunctionParameter
                    Once you make these changes you should be able to switch on and off the alerts from Edit Studies
                    Alex


                    Originally posted by James 88
                    Hi Alex

                    How can I select "alerts" on/off in edit studies. (I've tried to understand the tutorials but became a little confused.)

                    Kind Rgds

                    James

                    Comment


                    • #55
                      Hi Alex

                      Thx for you help... think I've managed to do it.

                      Regards
                      James
                      Last edited by James 88; 12-17-2007, 08:04 AM.

                      Comment

                      Working...
                      X