Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

IsSelected unexpected behavior

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

    IsSelected unexpected behavior

    I have an indicator that draws multiple rectangles.
    It has a function that handles mouse button events. ChartControl.MouseLeftButtonDown += MouseClicked;

    The function loops over rectangles an does some actions with the one that user selects.

    foreach (Zone D in DemandZones)
    {
    if (D.Z.IsSelected)
    {
    Log("clicked on " + D.Z.Tag , LogLevel.Information);
    }
    }​

    It works fine. However, if user selects a rectangle and UNLOCKS it, the rectangle remains Selected. Now this functions find two selected rectangles: the one that has been unlocked and a new one the user clicks after. Locking that first one back does not change anything, it remains Selected.​

    #2
    Hello LeonK,

    Thanks for your post.

    What version of NinjaTrader are you using? Please provide the entire version number. This can be found under Help -> About (Example: 8.?.?.?)​

    Please create and share a reduced simple test indicator that reproduces the behavior and the exact steps and settings used to reproduce the behavior so we may look into this further.

    Note that a reduced copy refers to a copy of the script that contains the minimum amount of code needed to reproduce the issue. All other code is commented out or removed.

    To create a copy of your script to modify, open a New > NinjaScript Editor, select your script, right-click in the Editor, select 'Save as', name the script, and click OK.​

    To export the simple test indicator, go to Tools > Export > NinjaScript AddOn.

    I look forward to assisting further.
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by AaronKoRn, Today, 09:49 PM
    0 responses
    2 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Today, 08:42 PM
    0 responses
    8 views
    0 likes
    Last Post carnitron  
    Started by strategist007, Today, 07:51 PM
    0 responses
    9 views
    0 likes
    Last Post strategist007  
    Started by StockTrader88, 03-06-2021, 08:58 AM
    44 responses
    3,975 views
    3 likes
    Last Post jhudas88  
    Started by rbeckmann05, Today, 06:48 PM
    0 responses
    9 views
    0 likes
    Last Post rbeckmann05  
    Working...
    X