Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Risk-Reward Drawing Tool Bug

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

    Risk-Reward Drawing Tool Bug

    When editing a Risk-Reward Drawing Tool, moving the Reward anchor (or Risk anchor) updates the other anchors as the anchor is moved. This is the behavior I would expect, but this is not true for the Entry anchor.

    When moving the Entry anchor, the Reward and Risk anchors are not updated as the anchor is moved. The tool is only updated after editing is complete (clicking off the tool) or by subsequently moving the Risk or Reward anchor.

    This can be fixed by replacing the following code snippet in the OnMouseMove override:
    Code:
                
                else if (DrawingState == DrawingState.Editing && editingAnchor != null)
                {
                    dataPoint.CopyDataValues(editingAnchor);
                    if (editingAnchor != EntryAnchor)
                    {
                        if (editingAnchor != RewardAnchor && Ratio.ApproxCompare(0) != 0)
                            SetReward();
                        else if (Ratio.ApproxCompare(0) != 0)
                            SetRisk();
                    }
                }
    ​
    with the following code:
    Code:
                else if (DrawingState == DrawingState.Editing && editingAnchor != null)
                {
                    dataPoint.CopyDataValues(editingAnchor);
                    if (editingAnchor == EntryAnchor)
                    {
                        if (Ratio.ApproxCompare(0) != 0)
                        {
                            SetReward();
                            SetRisk();
                        }
                    }
                    else
                    {
                        if (editingAnchor != RewardAnchor && Ratio.ApproxCompare(0) != 0) SetReward();
                        else if (Ratio.ApproxCompare(0) != 0) SetRisk();
                    }
                }
    ​
    Last edited by TheTradingMantis; 06-01-2024, 06:15 AM. Reason: Clarified the issue when editing the Risk-Reward tool.
    The Trading Mantis
    NinjaTrader Ecosystem Vendor - The Trading Mantis

    #2
    Hello TheTradingMantis,

    Thank you for the suggestion, with how the tool is currently designed it does need to wait for a chart update to recalculate the values after moving the anchor. I will make a note about this for development to review further.


    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    174 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    329 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    252 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    356 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    183 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Working...
    X