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

Snap Mode

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

    Snap Mode

    Hello

    I am creating two custom DrawingTools and I have a problem with the snap mode.

    I am setting the Snap mode in OnRender method like this :

    ChartControlProperties myProperty = chartControl.Properties;
    myProperty.SnapMode = SnapMode.Bar;

    One DrawingTools needs to use Snap Mode Bar and the other Snap Mode Bar And Price.

    When I apply them one after the other the second drawing tool first Anchor point is always wrong ( the others being fine ).

    For example if I apply the DrawingTools SnapMode.Bar first
    when I apply the DrawingTools SnapMode.BarAndPrice the first anchor point will set the point as SnapMode Bar !

    I tried to set myProperty in MouseDown and OnRender without any success.

    Is there a way to set myProperty elsewhere so that the SnapMode will work properly for all anchor points.


    Thank you






    #2
    Hello blar58, thanks for writing in.

    The help guide page on ChartControl includes a warning about setting the properties through a script:


    Warning: These are UI properties that are designed to be set by a user. Attempting to modify these values through a custom script is NOT guaranteed to take effect.
    There's no guarantee that setting the SnapMode property will be set through the calling NinjaScript object, we recommend only setting these properties through the user interface.

    Please let me know if I can provide any further information.


    Chris L.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by mjairg, 07-20-2023, 11:57 PM
    3 responses
    213 views
    1 like
    Last Post PaulMohn  
    Started by TheWhiteDragon, 01-21-2019, 12:44 PM
    4 responses
    544 views
    0 likes
    Last Post PaulMohn  
    Started by GLFX005, Today, 03:23 AM
    0 responses
    3 views
    0 likes
    Last Post GLFX005
    by GLFX005
     
    Started by XXtrader, Yesterday, 11:30 PM
    2 responses
    12 views
    0 likes
    Last Post XXtrader  
    Started by Waxavi, Today, 02:10 AM
    0 responses
    7 views
    0 likes
    Last Post Waxavi
    by Waxavi
     
    Working...
    X