Announcement

Collapse
No announcement yet.

Live/Active bar

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

  • Live/Active bar

    Hi,

    I wonder if somebody can point me in the right direction.

    I want to change the colour of the ative/live bar to something else until it has completed.

    I find the realtime bar distracting as it is forming and wanted to mainly focus on the prior completed bar.

    The only function support I can see is getBarState().
    However, it signals a "BARSTATE_NEWBAR" which is the first tick of the new bar and not that the current bar has completed.

    I have not found a way to colour a bar retrospectively...

    Any help would be appreciated.

    Kind regards,
    Rene'.

  • #2
    solution..

    you would use..

    getCurrentBarIndex() == 0

    When this value == 0, you are on the most current REALTIME bar. You could then use the color functions to change this bar's color.

    I believe you would have to use other functions to redraw the bars (as they complete) to a default color.

    B
    Brad Matheny
    eSignal Solution Provider since 2000

    Comment


    • #3
      Hi,

      Thanks for your reply.

      I think you may have misunderstood my question...or I have misunstood your answer.

      In any event, I would like to achieve the following;

      To change the color (or set to hollow) the most current realtime bar. ie using the "setPriceBarColor" to change the current bar.

      However, as a new bar/tick arrives, I seem unable to change the color of the previous bar as the coloring functions only work on the current real-time bar.

      I think what is needed is a status message from "getBarState" with a "BARSTATE_BARCOMPLETE" or something to perform any last actions on the current bar (ie. change the colors etc) before the new tick creates a new bar and the old current bar becomes the previous bar.

      Or, allowing color/drawing manipulations on any bar index, in which case I could use the arrival of the new tick to change the previous bar.

      Rene'.

      Comment


      • #4
        It appears..

        you are correct.

        setPriceBarColor( Color, [WickColor], [bThinWick], [bHollow] )


        · Color: A valid color definition or RGB value.
        · WickColor: Optional - set wick color.
        · bThinWick: Optional - set thin wick (true or false).
        · bHollow: Optional - set hollow candle (true or false).

        Sets the bar color for the current bar.

        Example:

        setPriceBarColor( Color.green );

        This would be a great example of a request to send to [email protected]...

        Here is how I would suggest you word your request..

        Gentlemen,

        I would like to request an addition to the setPriceBarColor() (and other related functions) in EFS. I would like to be able to color PAST and CURRENT bars at will - thus passing a price bar parameter with this function (like setPriceBarColor( Color.green, -3 );. Please add it to your future updates..

        Thank you,

        You.
        Brad Matheny
        eSignal Solution Provider since 2000

        Comment


        • #5
          Hello Brad/Rene,

          You could use the setBar() function to change the color of the historical bars.

          At BARSTATE_NEWBAR, which is the first instance (or execution) in the EFS when we know a bar just closed, use setBar() to reset the bar's color that just closed. Reference bar -1.
          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
            Thanks Jason...

            Good to know you've "got my back"... How's golf?? Playing today - wish you were closer.
            Brad Matheny
            eSignal Solution Provider since 2000

            Comment


            • #7
              This won't work for the price bar colors however. We would need a modification to either setBar() or the setPriceBarColor() functions as Brad suggested.
              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

              Working...
              X