Announcement

Collapse
No announcement yet.

Turning off one of CursorLabel if there are more than one

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

  • Turning off one of CursorLabel if there are more than one

    I am going crazy trying to figure out how to do this....its probably very simple, but I am am stuck!!!
    I want to plot volume as a histogram, and show in the cursorlabel volume and another data item which I will just call x.

    So, as part of my script, I am plotting the esignal-type basic volume histogram, with the histogram color being either red or blue depending on the open() and close() values.

    Maybe I am not well-versed enough with Java, but originally, everytime I had returned volume() after changing BarFgColor (depending on Open() and Close() ), the cursorlabel holding my "Volume" would also change color. So, I thought it would be necessary to return volume TWICE. Once for the histogram plot, and once for the cursorlabel.

    So now, my cursor labels look fine because they never change color (they are defined as 1 and 2). But the histogram (defined as 0) still keeps showing up in the cursorlabel as multicolored garbage.

    How do I get rid of this???? or rather, what am I doing wrong?



    Another similar problem with my script is that volume (I presume my second volume that I return), is being plotted as a line.... I want to turn this off as well.

    I guess my overall question is when returning values, how do I make sure they only get plotted or only end up in the cursor label, depending on what I want???
    Last edited by PJVex; 12-19-2003, 05:27 PM.
    Parker

  • #2
    I did research this first!

    I had researched my question first and tried to use setShowCursorLabel(false,0), but I got an "Invalid number of arguments (3) for setShowCursorLabel()" error.

    So then I thought, well, I must have to set a true/false flag for each item, so I setShowCursorLabel (false,0) and 1 and 2 to true. Then I got an "Unterminated regular expression literal: setShowCursorLabel (false, 0)" error.

    From my research at the EFS help center, I would have thought that this would work, but it does not seem to. ???
    Last edited by PJVex; 12-19-2003, 08:26 PM.
    Parker

    Comment


    • #3
      Parker
      setShowCursorLabel() is only true or false and does not get assigned to a specific item.
      As an aside you can obtain the same result by right clicking the Cursor Window and unchecking the corresponding study/indicator. This is an "all or none" setting meaning that you cannot selectively pick which item returned from a study/indicator you want to show or not show.
      Alex

      Comment


      • #4
        Alexis:


        This is straight from the the EFS Help Center:

        ------------------------------------------------------------------------
        setShowCursorLabel()

        setShowCursorLabel( bShow, nCount )

        bShow: true or false.
        nCount: Optional. If your study returns multiple values, specify the return value here.

        Determines whether or not this particular cursor label will appear in the cursor window.

        If your EFS returns one value, the following would be a valid use of setShowCursorLabel:

        setShowCursorLabel( true );

        If your EFS returns 3 values and you wanted the first cursor label only to appear in the cursor window:

        setShowCursorLabel( true, 0 );
        setShowCursorLabel( false, 1 );
        setShowCursorLabel( false, 2 );

        --------------------------------------------------------------

        So....this is incorrect? It would appear you can turn off individual data items.
        Parker

        Comment


        • #5
          Parker:

          Sorry. That help description was my mistake. When I put together that entry I mistakenly included that example. It was probably wishful thinking on my part I will fix that example in the next help file update. As it stands, Alex's description is correct.

          Chris

          Comment


          • #6
            OK, well then I am back to my problem which I know can be solved.

            The reason I wanted to shut off one cursor label is because I am returning volume() twice. The reason I am doind this is because I change the volume bar red or blue (just like the builtin esignal version), yet I do not want the cursor label to change as well.

            So I guess I can just return volume() once, but how do I keep the color of the bar red or blue, and in the cursor show "Volume" and value of volume() but keep the cursor background blue with white text?

            Thanks for your help!

            Last edited by PJVex; 12-20-2003, 08:51 AM.
            Parker

            Comment


            • #7
              Parker
              I don't know if one can have a different color cursor label than what is returned by the efs. While someone comes up with a solution (if any) here is a possible workaround.
              In your first message you mentioned that you return volume and another "x" item. Instead of doing that just return the "x" item and then overlay that study to the Basic Studies Volume (which maintains the same color in the Cursor Window).
              To overlay the studies click and drag one study over the other while pressing the <Shift> button.
              Just an idea
              Alex

              Comment


              • #8
                So Alex you are saying then that one cannot write an efs to duplicate the builtin study of volume in eSignal? The builtin version changes the color of the bars based on open() and close(), yet the cursor label background is always blue. Are you sure??


                One more related question for the experts...as a way of background, I am trying to write a script that will change the background in a standard volume indicator based on whether the volume reaches certain levels. For example, on the 5 minute chart, if volume for the bar is greater or equal to 2500 but less than 6000 then it would be a, say, a "level 3", if the volume was greater or equal to 6000 but less than 10,000, it would be a "level 2", and greater than 10,000 volume for the bar would be a "level 1". Each level in my volume study indicator would have a different background color or a shade of one color.

                My question is...can I write an indicator that will essentially use the above numbers for the 5 minute but extrapolate them to any inteveral (minutes only) used?

                I thought that if I reduce all my values to a 1 minute chart and go from there it would work.....for a 1 minute chart, I would have "level 3" values from 500 (i.e. 2500 / 5) to 1200, "level 2" values from 1200 to 2000, etc. If I assign these values to a variable-- for instance OneMinLev3 = 500-- then multiply this fixed variable times "getBarInterval()" I would get the number I need to check for a given interval..... so far so good.....

                But, I guess my real question is what am I actually getting returned when I use "volume()" function to compare with the above product? I thought it was the cumulative volume at a given tick for the current interval bar. Is this correct?
                Parker

                Comment


                • #9
                  Parker
                  I am aware that the cursor for Basic Study Volume does not change color even though the histogram can be colored either by the close being higher/lower than the prior close or the volume bar itself being higher/lower than the prior bar. That is why I suggested the overlay method at least as a temporary workaround.
                  The fact that the builtin can do certain things is not necessarily indicative that it can always be done with efs. The builtin averages for example plot beyond the current bar when offset forward whereas that does not happen with an efs without using some extra code.
                  No I am not sure that what you are asking can't be done, only saying that while waiting for a solution you may have a workaround.
                  Alex

                  Comment


                  • #10
                    This is an old thread that discusses controlling the color of the Cursor Label and the Cursor Text. It indicates that a possible solution might be forthcoming.

                    I am interested in controlling the cursor color in one of my scripts because the combination the efs engine if returning is pretty unreadable.

                    At this time, is there now any way for me to control the cursor label color and/or the cursor text color?

                    Thanks. Joe.

                    Comment


                    • #11
                      Hi Joe,

                      I believe the thread was addressing Basic Studies and not Advanced studies where you are running an efs. Regardless, the way you color the background of the data being displayed in the cursor window is to set this in preMain or you can use a conditional within the efs to modify the color.

                      here is the step

                      setDefaultBarFgColor(Color.blue, 0);

                      To color the cursor text, pull up the properties dialog (by right clicking the chart)



                      Then select the Cursor Window Text color.

                      Hope this helps.

                      Comment

                      Working...
                      X