Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Printing Text on chart

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

    Printing Text on chart

    Hi, with the help of you guys, I created my first strategy. In my strategy, I have a risk management section, where I print the risk of a running trade. Which kind of look like this:

    Code:
    Draw.TextFixed(this, "Risk", "Total Risk: $" + RiskCash.ToString(), TextPosition.BottomRight);
    The problem is that it only shows the last value of "RiskCash" variable. What I want to do is, I want to hover over the chart and want to check the value of "RiskCash" at any point. I could put it inside of databox as a hidden plot, but it would be more helpful if I could put it here. Is this possible?

    #2
    Hello fawzanalim,

    Thank you for your post.

    This would be possible with custom rendering. The attached example subscribes to a mouse hover event and uses ChartBars.GetBarIdxByX to get a BarIndex.

    That BarIndex is then used with a Series<double> and GetValueAt to draw that series value using DrawTextLayout in OnRender. We would recommend this over using Draw.TextFixed in the mouse event for performance reasons.

    Please let us know if we may be of further assistance to you.
    Attached Files

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    63 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    91 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    48 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    105 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    63 views
    0 likes
    Last Post PaulMohn  
    Working...
    X