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

How to know which candle bar was clicked?

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

    How to know which candle bar was clicked?

    i click left button of mouse on a candle bar. is there a easier way to know which candle bar i clicked programmatically?

    Thanks

    #2
    Hello UMLer,

    One way would be to use the mouse down point in OnRender and then convert the X to a bar. There is a sample of that concept here: https://ninjatrader.com/support/help...lightsub=mouse

    After having an X value you can use the GetBarIdxByX method: https://ninjatrader.com/support/help...tbaridxbyx.htm

    That would result in the bars ID which can be used with any of the series GetValueAt method when using OnRender.

    Close.GetValueAt(barId);



    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Gerik, Today, 09:40 AM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by RookieTrader, Today, 09:37 AM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by alifarahani, Today, 09:40 AM
    0 responses
    5 views
    0 likes
    Last Post alifarahani  
    Started by KennyK, 05-29-2017, 02:02 AM
    3 responses
    1,285 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by AttiM, 02-14-2024, 05:20 PM
    11 responses
    186 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X