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 argusthome, 03-08-2026, 10:06 AM
    0 responses
    68 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    41 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    24 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    27 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    54 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X