Announcement

Collapse
No announcement yet.

Vol study

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

  • Vol study

    Hi

    I am trying to create a volume study. but it's not working(attached)

    all it needs to do is

    vol close < 250
    then
    fcbar 00ffff

    basically, i want the bars to turn yellow everytime there is a closed bar below 250v.

    But it is not plotting on my chart. Can someone please help.
    Thanks very much
    Attached Files
    Last edited by mashhad; 03-06-2005, 09:31 AM.

  • #2
    Hi,
    Try this out.
    Your example study showed OBV, but I think that is a mistake. I am assuming that you want to deal with standard volume and not On Balance Volume.

    You will have the option of changing the Volume Limit to any number and changing the bar colors.

    There are 3 options for different types of bars:
    1- Any bar with volume less than your limit (250 is your default).
    2- A bar with volume above the limit and close above the prior bar close.
    3- A bar with volume above the limit and close below the prior bar close.

    If you want to see only one color of bar for bars above the limit, just set both Up and Down parameters to the same color.

    Good luck.

    Bob
    Attached Files

    Comment


    • #3
      Hi Bob

      thanks so much for this study.
      However, what i am trying to do is have the colors change on the volume subgraph not on the main price bar Graph.

      I am using another study for my Price bars, so would it be possible to make the study so it changes the colors below on the subgraph??

      I would really appretiate it,
      Ray

      Comment


      • #4
        Ok,
        Here you go.
        There is now the choice of Price Bar study or Volume bar study.
        I just threw it together, so caution please.

        The default is Volume Bars.

        Change it it Edit Studies.

        One minor bug...when changing from a Volume Bar subgraph study to a Price Bar Study, the subgraph window does not disappear from the chart...it stays there but is empty and the study changes the price bar colors as it is supposed to.

        I don't have time to pursue this bug now...perhaps you can Jasor or Alex if this is a known bug?

        Good luck, Bob
        Attached Files

        Comment


        • #5
          Hello Bob and Ray,

          If you apply a study that is set as a non-price study and then subsequently change the code to a price study, reloading the study will not move it to the price pane automatically as you're expecting. The study needs to be manually removed and then reapplied in order for the preMain() settings to get reinitialized, which is the only way to get the setPriceStudy(true) setting to take affect. This is not a bug.
          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


          • #6
            Thank you Bob.
            Jason, I am not sure what you mean by doing it manually.
            What i did was using the control and shift key and dragged the study on top of the regular vol. subgraph.
            Then i edited Bob's study and changed the green and red colors to a neutral gray... and that allowed for the bars with vol<250 to show a slight yellow tail. Not very visible, but unless if there is a better solution, i guess i will use this.

            But if there is something else i can do , please let me know.
            Regards
            Ray

            Comment


            • #7
              Hello Ray,

              To remove a formula manually you right-click on the chart, highlight "Remove" with your mouse and select the formula to remove from the list. Then you would need to reapply the formula manually by right-clicking on the chart again, highlight "Formulas" and navigate to the formula's location and select it.
              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


              • #8
                mashad,
                Do not drag my study on top of a regular volume study. There is no need to do this and it is not how it was intended to be used. The reason some of your colors are turning to a neutral grey is because the bars are now a combination of two different colors and two different studies...so don't do it.

                Simply load the study and you should see volume bars of whatever color you choose. The default in version 2 is set to show volume bars and not price bars.

                Jason,
                In response to your reply: You can see that I have written the study to call preMain() each time it is reloaded. In preMain, there is a switch() function which is supposed to set the study to be either a Price Bar study or a sub-window study.

                You say it is not a bug that such a call to a function in preMain has no effect on the chart, but it seems to me that if it isn't a bug it is at least an insect. And insects bug me...

                This "insect" invalidates any reason for permitting a choice in Edit Studies if the default is for a sub-window....so...I will change the formula soon so that there will no longer be a choice within the Edit Studies to make it either a price or a volume bar study. There will simply be two seperate studies to download...one for price bars and one for volume bars.

                Thanks all, Bob

                Comment


                • #9
                  Bob Wrote:
                  Simply load the study and you should see volume bars of whatever color you choose. The default in version 2 is set to show volume bars and not price bars.
                  Bob,
                  the problem is the study is not showing correct colors on it's vol bars.
                  Try it on a 2 min chart,
                  put a regular volume sub-graph next to the study's sub-graph. It is not consistent. The Bar colors are not correctly matching. I am talking about The Red and Green... Of course the yellow is and that's why when I drag it on top , the yellow works. But some of the red bars on the vol sub-graph will show green on the study, and some of the blue will show red!

                  is it possible to make it so it is consistent with info.on a reg. vol chart?
                  Last edited by mashhad; 03-08-2005, 11:11 AM.

                  Comment


                  • #10
                    mashad,
                    You have probably not looked in the Edit Studies window and noticed that you have two choices for how the built in volume study colors the bars.

                    Go into Edit Studies, select Volume, and you will see that you have two buttons at the top of the edit window. One says "color bars based on previous volume bar" and the other, which is the default, says "color bars based on current price bar".

                    I did not offer you this choice. I thought you would want to color the volume bars based on the previous volume bar, not on the price bars. The piece of programming which handles this is the following:

                    case "V":
                    vThis = vFinalVol = volume();
                    if(vFinalVol < vLimit){
                    setBarFgColor( vLimitCol );
                    }//end if vFinalVol
                    else{//volume is above the Minimum
                    if(vThis >= vPrior){
                    setBarFgColor(vUpCol);
                    }
                    else if(vThis < vPrior){
                    setBarFgColor(vDnCol);
                    }
                    }//end else volume is above the minimum

                    In this case, there is unnecessary redundancy in the first line because I was altering the code for you in a hurry. Nevertheless, the variable named vThis holds the currently building volume number in real time, and the variable named vPrior holds the total volume for the preceeding bar. Therefore, the volume bars are colored based on the comparison of volumes, not of prices.

                    It is easy enough to change, but try changing the builtin volume bars first and see they do indeed match. I will add the coloring option when I re-do the study sometime soon.

                    Bob

                    Comment


                    • #11
                      Thanks Bob,
                      I will try alterning the formula as you indicated. But i look forward to seeing your finished one if you ever get the chance.
                      I really appretiate the help.
                      Ray

                      Comment


                      • #12
                        mashhad,
                        Ok, here you go. I am only posting a study which deals with volume bars, since there hasn't been any interest in coloring the price bars.

                        You can alter the colors, the volume minimum, and the method of coloring the volume bars which are above the minimum.

                        I'll check back to see if there is any problem.

                        Good luck,
                        Bob
                        Attached Files

                        Comment


                        • #13
                          Hi Bob,
                          unfortunatly , this has the exact same problem as the one b4,
                          r u sure u posted the correct attachment?

                          Regards
                          Ray

                          Comment


                          • #14
                            Hi Ray,
                            I am looking at the study now and comparing it to a volume study. They are both the same when they are set to the same parameters, so...do this:

                            Go into Edit Studies and check your regular volume study to see if it is set to "Color bars based on current price bar" or "Color bars based on previous volume bar". Then check the study I just sent you. You will see a parameter named "Color Bars According To" and there is a little arrow box at the right. Click on the arrow and select the choice that matches your setting for the standard volume study.

                            I just noticed that I set the default to be Color Bars According To Previous Volume Bar...which apparently is not the one you want.

                            Let me know how this works for you.

                            Bob

                            Comment


                            • #15
                              Bob,
                              I am looking in the study but can't find what you are reffering to..

                              do u mean line #97, where it says:
                              case "P"://Colorvolume bars according to Price Close

                              or line # 113 where it says:
                              case "V"://Color bolume bars according to Volume

                              or another line item that i am missing here?
                              Thanks
                              Ray

                              Comment

                              Working...
                              X