Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Changing snap mode programatically

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

    Changing snap mode programatically

    Hi,

    Is there a way to programatically switch between snap modes?

    I have gone through the language reference section and I have only found the ignoresnapping property somewhat related. Yet, this property does not allow what I want.

    Here what I want to do when drawing, for instance, a trend line:
    * I select the trendline tool and I want then the snap mode to go disabled (if it was enabled).
    * After I click to set the first anchor, I want bar&price snapping to become enabled.
    * When I click for the second anchor, and the trendline is drawn, I want snap mode to be disabled again.

    Today, I do this process through the corresponding hotkeys (snap mode) and with this post I am checking if I could do it in code, programming my own trendlines with such behaviours.

    I look forward to hear from you...

    Thanks,

    #2
    Hello ludopuig,

    The snap mode is one of the ChartControl properties.

    ChartControl.Properties.SnapMode

    Below is a public link to the help guide.


    Changing this is not guaranteed to have affect.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi,

      Thank you for your quick answer but... what do you mean when you say "Changing this is not guaranteed to have an affect"?

      Comment


        #4
        Hello ludopuig,

        Not all ChartControl properties can be changed in all situations.

        From the help guide page I have linked in my previous post:
        "Warning: These are UI properties which are designed to be set by a user. Attempting to modify these values through a custom script is NOT guaranteed to take effect."
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Ok, I see. Thank you for your help...

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          578 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          334 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          554 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          551 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X