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

Programmatically copy and paste and invert a user drawn Ray or Extended Line

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

    Programmatically copy and paste and invert a user drawn Ray or Extended Line

    Hi,

    I want to "invert" a user drawn Ray or Extended Line. At the moment, I have to copy and paste the Ray/Extended Line and then swap the "Start Y" and "End Y" which is a hassle.
    My ambition is to create an add-on that will listen to a hotkey and then copy -> paste -> invert the Ray/Extended Line automatically. Can you provide some tips on how this can be done?

    Thanks!

    PS I know the hotkey part but it's accessing the copy and paste function that's difficult for me.

    #2
    Hello mav8rick,

    Thanks for the post.

    There would not be a way to programaitically copy/paste to invert the values but you could use code to re draw the object based on new values you had calculated. A script could be used to watch for the keyboard event to toggle and then locate the object and redraw it.



    I look forward to being of further assistance.

    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks for your reply Jesse,

      The issue is that I need the mirrored line to be "draggable" so programmatically drawing the line would not cut it. Guess I have to figure a way to use an external program to drive a series of keystrokes or something. If you have any idea how I can achieve this - mirror the user drawn line as another user drawn line - just let me know.

      Comment


        #4
        Hello mav8rick,

        Outside of using the Draw. methods there is not necessarily a way to make a manually drawn line without just drawing it yourself. You can unlock the line after drawing it if you needed to later move it. You can find an example in the following forum post: https://ninjatrader.com/support/foru...05#post1077405

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Thanks Jesse - I'll try that!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by judysamnt7, 03-13-2023, 09:11 AM
          4 responses
          59 views
          0 likes
          Last Post DynamicTest  
          Started by ScottWalsh, Today, 06:52 PM
          4 responses
          36 views
          0 likes
          Last Post ScottWalsh  
          Started by olisav57, Today, 07:39 PM
          0 responses
          7 views
          0 likes
          Last Post olisav57  
          Started by trilliantrader, Today, 03:01 PM
          2 responses
          21 views
          0 likes
          Last Post helpwanted  
          Started by cre8able, Today, 07:24 PM
          0 responses
          10 views
          0 likes
          Last Post cre8able  
          Working...
          X