Announcement

Collapse
No announcement yet.

drawTextRelative

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

  • drawTextRelative

    Shouldn't this draw some text with color?

    drawTextAbsolute(40, 20, "Go SHORT @URL=EFS:Short", Color.blue, Color.white, Text.BUTTON | Text.CENTER | Text.RELATIVETOLEFT | Text.RELATIVETOBOTTOM, null, 12, 2);

  • #2
    David,

    There seems to be something about the Text.BUTTON flag that does this. Not sure why.

    Garth
    Garth

    Comment


    • #3
      Chris says...

      No Bg or Fg on Text.BUTTON
      Attached Files

      Comment


      • #4
        hmmm..

        drawTextAbsolute(40, 20, "Go SHORT @URL=EFS:Short", Color.blue, Color.white, /*Text.BUTTON | */Text.CENTER | Text.RELATIVETOLEFT | Text.RELATIVETOBOTTOM, null, 12, 2);

        works just same as drawing a button but the the colors work.

        Guess I don't need no stinkin' button.

        Comment


        • #5
          David
          If one uses the BUTTON flags though it will color the text and button
          drawTextAbsolute(40, 20, "Go SHORT @URL=EFS:Short", Color.red, Color.yellow, Text.BUTTON_RIGHT | Text.CENTER | Text.RELATIVETOLEFT | Text.RELATIVETOBOTTOM, null, 12, 2);
          Alex

          Comment


          • #6
            Hi Alex:

            I'm not 100% positive but I think in your example it is just ignoring the Text.BUTTON_RIGHT flag altogether (because I don't think it actually exists) and it ultimately just drawing it as text (so the Fg/Bg colors are used). You can test this by changing Text.BUTTON_RIGHT to Text.DONOTHING (which we know does not exist). The line will still print and no error will be generated but EFS is simply ignoring the TEXT.DONOTHING flag. When you use the actual Text.BUTTON flag, the Fg/Bg colors are completely ignored.

            Chris

            Comment


            • #7
              I have been playing around with buttons etc and came up with an efs that draws a box at each price level near the current price, the user selects short or long, then when the user clicks on a text box at a given price level a stoplimit order is sent to IB.

              When the order is filled a stoplimit order is automatically sent to close the trade.

              The bid and ask is shown next to the corresponding price level.

              An ExitNow button is also present as is an Update button to readjust the stoplimit order text boxes.

              This efs uses dynaorder and will not work - ie lots of error messages - if you do not have dynaorder loaded.

              Even though, I though it might be of interest.

              Picture attached, efs to follow
              Attached Files

              Comment


              • #8
                I forgot to add, you need to move the price chart over to the right by right clicking Properties, I set mine at 25 or so

                Here is the efs....
                Attached Files

                Comment

                Working...
                X