Announcement

Collapse
No announcement yet.

False bar stochastic

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

  • False bar stochastic

    You guys are great, the assistance you have given me is greatly appreciated.

    As my EFS develops, other questions always seem to come up, here is my next quesstion:

    Is it possible to create an if statement where the condition is
    - when stochastics line or lines are above 75 turning down, check to see if a stochastics false bar (upper) exists, if it does exist, the condition will result in a false, if it does not exist, the condition will result in a true.

    I am an eSignal Premier user and also an Advanced GET user.

    Hopefully this is an easy question to answer.

    Royce

  • #2
    Royce
    Yes it is possible. If you run a search in the forums for the keyword stochastic false bar you should find various scripts that are based on the AdvancedGET Stochastic function and that you can use as examples for your script.
    Alex

    Comment


    • #3
      Hi Alex

      Thanks for your response, I am still searching but having difficulty finding an example that makes sense to me.

      To save me a ton of time, can you tell me if there is a symbol that represents a stochastics false bar under a specified timeframe

      e.g. like ATR(5)

      Again, your assistance is greatly appreciated

      Royce

      Comment


      • #4
        Royce
        The description of the Get Stochastic function and its methods is available in this article in the EFS KnowledgeBase
        As I indicated in my previous reply if you search the forums you will find complete working examples showing how to use the GetStochStudy() function
        Alex

        Comment


        • #5
          Hi Alex

          I have spent a lot of time searching for examples based on the search definition you suggested and was only able to find one example. I believe this is a study you wrote for another esignal customer. Would you be kind enough to explain the following logic for me, to ensure I am understanding was has been developed

          if(vStoch.getValue(GetStochStudy.STOCHK,-1) < vStoch.getValue(GetStochStudy.STOCHD,-1) &&
          vStoch.getValue(GetStochStudy.STOCHK) > vStoch.getValue(GetStochStudy.STOCHD)){
          vCrossUp = true;
          }else{
          vCrossUp = false;
          }

          if(vStoch.getValue(GetStochStudy.STOCHK,-1) > vStoch.getValue(GetStochStudy.STOCHD,-1) &&
          vStoch.getValue(GetStochStudy.STOCHK) < vStoch.getValue(GetStochStudy.STOCHD)){
          vCrossDn = true;
          }else{
          vCrossDn = false;
          }

          This section determines if stochastics is crossing either up or down and then setting the vCrossUp and vCrossDn variables

          if (vStoch.getValue(GetStochStudy.MARKS) == 1){
          drawShapeRelative(0,0,Shape.SQUARE,"",Color.black, Shape.RELATIVETOTOP|Shape.ONTOP,"MarksUp"+ BarCount);
          }else{
          removeShape("MarksUp"+BarCount);
          }
          if (vStoch.getValue(GetStochStudy.MARKS) == 2){
          drawShapeRelative(0,-4,Shape.SQUARE,"",Color.black,Shape.RELATIVETOBOTT OM|Shape.ONTOP,"MarksDn"+ BarCount);
          //}else{
          //removeShape("MarksDn"+BarCount);
          }

          I believe this section, identifies if a stochastics False Bar exists either on the top or bottom and if the condition is true, draws the false bar on the price bar chart accordingly.

          if (vStoch.getValue(GetStochStudy.MARKS,-1) == 0 && vStoch.getValue(GetStochStudy.MARKS) == 1){
          vFlag=1;
          }
          if (vStoch.getValue(GetStochStudy.MARKS,-1) == 1 && vStoch.getValue(GetStochStudy.MARKS) == 0 ){
          vFlag=2;

          I am thinking that this section determines if the false bar is either starting or ending - not sure here.

          if (vFlag == 2 && vStoch.getValue(GetStochStudy.STOCHK,-1) < Lower && vCrossUp == true){
          drawTextRelative(0,low(),"é",Color.white,Color.blu e,Text.TOP|Text.CENTER|Text.BOLD|Text.ONTOP,"Wingd ings",10,"Up1"+ BarCount);
          Alert.playSound("Punch.wav");
          Alert.addToList(getSymbol()+" "+getInterval(),"Crossing Up",Color.black,Color.blue);
          vFlag=0;
          //}else{
          //removeText("Up1"+BarCount);
          }
          else if (vFlag == 0 && vStoch.getValue(GetStochStudy.STOCHK,-1) < Lower && vCrossUp == true){
          drawTextRelative(0,low(),"é",Color.blue,null,Text. TOP|Text.CENTER|Text.BOLD,"Wingdings",10,"Up2"+ BarCount);
          //}else{
          //removeText("Up2"+BarCount);
          }
          else if (vCrossUp == true && vFlag == 0 ||
          vCrossUp == true && vFlag == 1 ||
          vCrossUp == true && vFlag == 2 ||
          vCrossUp == true && vFlag == -1 ||
          vCrossUp == true && vFlag == -2){
          drawTextRelative(0,low(),"é",Color.lightgrey,null, Text.TOP|Text.CENTER|Text.BOLD,"Wingdings",10,"Up3 "+ BarCount);
          //}else{
          //removeText("Up3"+BarCount);
          }

          This is the section where I get lost,
          - from the previous section, if vFlag == 2, it will draw a white arrow in a blue box, I cannot tell if and how this takes into consideration the existence or non-existence of the Stochastics false bar ?
          - the next if statement will draw a single blue arrow, this vFlag ==0 is not set by a previous if statement, therefore represents the default variable, which implys that it does not take into consideration the existence of a false bar.
          - And finally, the last if statement, meets all other stochastics crossing conditions, and it is not concerned with the location of the crossing and or does not seem to measure the existence of false bars.

          Can you let me know if I am reading this study correctly, if yes, does it not take into consideration the existence of false bars and then use this variable in the decision making process ?

          Sorry Alex, if my previous posts have made me look like I am not willing to work to successfully build my study. Not being a programmer has made this task frustrating and challenging.

          Thanks in advance for any clarification you can provide.

          Sincerely

          Royce


          I have attached the original study; getstochastic(price-signals-alerts)[1]
          Attached Files

          Comment


          • #6
            Hi Alex

            Please ignore the previous post, after spending further time on this study, I think I have a better understanding of how it works.

            I do have the following question about the study.

            Is there a way to indicate either a stoch cross either towards the false bar or away from the false bar using a different colour arrow?

            Thank You

            Royce

            Comment


            • #7
              Royce

              Is there a way to indicate either a stoch cross either towards the false bar or away from the false bar using a different colour arrow?
              There are several ways to accomplish that. One way is shown in the image enclosed below. In the example [based on the same syntax used in the posted efs] the first condition checks if there is an upper false bar while the subsequent conditions [enclosed within the same first conditional statement] check for a cross over or under and draw an up or down arrow in different colors.
              For your information in the same thread in which you found the efs there are other variations [of differing complexity] of the script which you may want to review and/or use as examples.
              Lastly, if - as you indicate - you are unfamiliar with programming in efs then I would strongly 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.
              Alex

              Comment


              • #8
                Thanks Alex, I will start working with the information you have provided. I have the following additional questions.

                In the "if" statement relating to the existence of a false bar, can I add in the inv(x) to indicate what timeframe I would like to be working in, (if I am trying to check for false bars in more than one timeframe).

                e.g.
                if (vStoch.getValue(GetStochStudy.MARKS,inv(5)) == 1){
                }

                I know this may sound like a simple question and through testing will determine the outcome, but sometimes getting the answer from a seasoned professional, I will know that what I am trying to build is possible and that if the answer is yes, that even if I have a coding error, I will know to continue working on my study until the correct results are obtained.

                Can you also clarify something for me:
                I have searched the internet, reviewed several Java Script books, and can not find a clear answer to this situation.

                If I am writing a EFS, which contain several "if" statements, my understanding is that in Java Script, a completed if statement, if followed by another separate/new "if" statement will execute once the first statement is complete, and continue?

                If there are 5 "if" statements in a row, they will all run, one after the other.

                If the EFS is setup to check for the condition on each tick, or printed ticket, if an all true condition occurs on the 3rd "if" statement, will it still run the remaining 2 if statements, or in any of the if statements, once the conditions have been met, on the next tick, will it return to the first "if" statement to re-start the process ?

                In some samples, I have noticed that the develper uses either a
                return;
                or
                return null;
                at the end of a series of "if" statements, can you explain under what conditions the return is required.

                I believe I am almost where I would like to be with my EFS. I appreciate all of your assistance to date.

                P.S. I have been using the EFS Glossary, the Knowledge Base and reviewed almost all of the EFS videos as suggested.

                Sincerely

                Royce Hamaguchi

                Comment


                • #9
                  Is this GetStochStudy available as I'm getting an error on line 61 when I tried to load the EFS.

                  Thanks,

                  Glen
                  Glen Demarco
                  [email protected]

                  Comment


                  • #10
                    Royce

                    In the "if" statement relating to the existence of a false bar, can I add in the inv(x) to indicate what timeframe I would like to be working in, (if I am trying to check for false bars in more than one timeframe).
                    At this time the Get Studies have not been ported to efs2 and are not enabled for use with the inv() or sym() functions [there are workarounds using efsInternal() or efsExternal()]

                    If I am writing a EFS, which contain several "if" statements, my understanding is that in Java Script, a completed if statement, if followed by another separate/new "if" statement will execute once the first statement is complete, and continue?
                    That is correct

                    If there are 5 "if" statements in a row, they will all run, one after the other.
                    That is correct

                    If the EFS is setup to check for the condition on each tick, or printed ticket, if an all true condition occurs on the 3rd "if" statement, will it still run the remaining 2 if statements, or in any of the if statements, once the conditions have been met, on the next tick, will it return to the first "if" statement to re-start the process ?
                    The formula engine will evaluate all the remaining conditions. In order to prevent the remaining conditions from being evaluated the statement would need to be written as if()...else if()...else if()...else. In this case the formula engine willl stop evaluating further conditions once one of them evaluates to true

                    In some samples, I have noticed that the develper uses either a
                    return;
                    or
                    return null;
                    at the end of a series of "if" statements, can you explain under what conditions the return is required.
                    The developer could be running some null checks. Without seeing a specific example I would not be able to tell you exactly what the purpose is in the instances you are referring to.
                    Alex

                    Comment


                    • #11
                      Glen
                      As far as I can tell the efs is working fine. Keep in mind that you need a subscription to the AdvancedGet Studies to be able to run the efs
                      Alex

                      Comment


                      • #12
                        Originally posted by Alexis C. Montenegro
                        Glen
                        As far as I can tell the efs is working fine. Keep in mind that you need a subscription to the AdvancedGet Studies to be able to run the efs
                        Alex
                        Alex,

                        Thank you Alex that explains it.
                        Glen Demarco
                        [email protected]

                        Comment

                        Working...
                        X