Announcement

Collapse
No announcement yet.

Relative Text Placement

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

  • Relative Text Placement

    How do I change this so that the text will appear below the low
    of the price bar. Also, if I want to add a variation of the same
    study to the chart, how do I change that study so that the text
    will appear below the already existing text that is below the price
    bar.

    drawTextRelative(-j, high(-j), vMynumbers[i], Color.blue, null,
    Text.ONTOP | Text.CENTER | Text.Bottom, "Courier New" , 10,
    i);

    Thanks for the help
    j l evans

  • #2
    j l evans
    The first thing you need to do is correct an error in the flag Text.Bottom which should be Text.BOTTOM
    To place the text on the Low of the bar replace the parameter high(-j) with low(-j). Also because at this point you need to align the top of the text to the Low of the bar replace the flag Text.BOTTOM with Text.TOP
    To place the text in a specific location you have two options. The simplest is to use one of the preset location parameters BelowBar1, BelowBar2, etc. This must be used in conjunction with the Text.PRESET flag. For more information see this article in the EFS KnowledgeBase which also contains a link to the drawText() function.
    The other is to use a spacing of your choice. For example in place of low(-j) you could write low(-j) - 0.05 while for the second object you would use low(-j) - 0.10 (note that these are just examples as the actual values will be dependant on the price range of the symbol).
    Alex

    Comment

    Working...
    X