Announcement

Collapse
No announcement yet.

a bug related to drawText(), chart scaling and onLButtonDown()

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

  • a bug related to drawText(), chart scaling and onLButtonDown()

    Hello,

    I just found a bug which seemed related to drawText(), chart scaling and onLButtonDown().

    This happens when there are many bars loaded so that the range bwtween the highest bar and the lowest bar significantly exceeds the price range of the viewable area.

    I tested and reproduced the bug using time frame template setting of 1min chart of 20 days from 8:00~16:15. The symbol is "NQ #F,1".

    I use onLButtonDown() to read the price level at which the mouse is clicked and draw a line and display the correponding price at the level.

    However the yValue passed to onLButtonDown() function is not correct and is higher than the value it should be. Moreover when using drawTextAbsolute() to draw that price using Text.VCENTER, the text label is drawn righ at the y level where the moused is clicked, while the line drawn using drawLineAbsolute() is drawn at the y level which is equal to yValue. The result is a line drawn above where I clicked my mouse and a text label at where I clicked my mouse but with incorrect price.

    This seems like a price scaling bug (some functions in the program thicks the chart is in log scale and others think it is in linear scale).

    I tried to turn on and turn off the four scaling options under "Scaling" menu, but I can not figure out a procedure to fix this issue. When the chart is in linear scale, some code in eSignal still thinks it is in log scale.

    Please investigate this issue and fix it as soon as possible. Thanks.

    - Clearpicks
    Attached Files

  • #2
    Please change the default screen width in the code to 1200 and also set the actual chart width to about 1200.



    if ( ScreenWidth == null || ! ( ScreenWidth > 0 && ScreenWidth <= 9600 ) ) {
    screenWidth = 1200;
    }
    else {
    screenWidth = ScreenWidth;
    }
    Attached Files

    Comment


    • #3
      Is there anyone who has tested it? Thanks.

      - Clearpicks

      Comment


      • #4
        Hello Clearpicks,

        The problem is actually related to the use of setHistogramBase() in preMain for a price study. If you remove that function the problem gets corrected.
        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


        • #5
          Jason,

          Thank you. The setHistogramBase() was mistakenly included when I did some copy and paste. After removing it, it worked fine. Sorry for wasting your time.


          - Clearpicks

          Comment


          • #6
            Hello Clearpicks,

            No problem at all. Thanks for the update.
            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