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

Preview of stop-loss

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

    Preview of stop-loss

    Hello,

    I would like to see preview of my SL (its size would be defined in a dialog box of the indicator) before placing my limit order. Let´s say that it would be displayed as a line X tics below cursor when pressing Shift key, and X tics above cursor when pressing Alt key. The line would be moving, when moving the cursor.
    I´m not sure how complicated would it be, nor how to start...

    Thank you
    emuns

    #2
    Hello emuns,

    This is possible, the most complicated part would be handling the mouse/keyboard events. By default there is no NinjaScript keyboard handling so you would be looking at using one of the ChartControls WPF keyboard events. This is not documented but you can search the forum for some existing posts using keyboard handlers. Searching for terms like "KeyDown", here is one example: https://ninjatrader.com/support/foru...99#post1055399

    For the mouse point, you can use MouseDownPoint assuming you wanted to Click.


    For hovering the mouse, you are again looking at the WPF events to locate the mouse. I would suggest searching online for general C# examples of tracking the mouses position in a WPF control, this would also apply here.

    Drawing is very simple once you have the values you wanted to draw, you can find many examples of drawing in the help guide:



    Alternatively you can use OnRender to draw as well.


    I look forward to being of further assistance.

    JesseNinjaTrader Customer Service

    Comment


      #3
      Originally posted by emuns View Post
      Hello,

      I would like to see preview of my SL (its size would be defined in a dialog box of the indicator) before placing my limit order. Let´s say that it would be displayed as a line X tics below cursor when pressing Shift key, and X tics above cursor when pressing Alt key. The line would be moving, when moving the cursor.
      I´m not sure how complicated would it be, nor how to start...

      Thank you
      emuns
      Hello

      Did you ever find out a way to accomplish this? This is exactly what I am trying to do as well.
      Thank You!

      Comment


        #4
        Originally posted by shanerprice View Post

        Hello

        Did you ever find out a way to accomplish this? This is exactly what I am trying to do as well.
        Thank You!
        Hello shanerprice,

        unfortunately, no. I'm not a capable enough programmer to make something like that myself. NT probably isn't planning anything like that anytime soon. Nor do I know of any (affordable) third party solution.

        Comment


          #5
          I've been working my way up to being able to code something like this. All in due time.
          But in the mean time, you may find this as a temporary solution:

          Figured this may help a few traders out there. Made some buttons on the chart trader panel to help with entries and managing orders (entered from the buttons) It is a ‘Strategy’ found under the strategies section. Works with Futures and Stocks​ Full explanation video on how to use these: https://youtu.be/WvO8Gwx3Fh0 Features include: It can […]



          You can adjust your Stop based on previous candles. Just push a button and it will automatically adjust your level.

          Made a whole video to explain how to use but I time stamped the part that explains how to adjust the levels using the buttons:


          Again not 100% what you were looking for but may be helpful for quickly adjusting your orders.

          Comment


            #6
            Originally posted by TradeSaber View Post
            I've been working my way up to being able to code something like this. All in due time.
            But in the mean time, you may find this as a temporary solution:

            Figured this may help a few traders out there. Made some buttons on the chart trader panel to help with entries and managing orders (entered from the buttons) It is a ‘Strategy’ found under the strategies section. Works with Futures and Stocks​ Full explanation video on how to use these: https://youtu.be/WvO8Gwx3Fh0 Features include: It can […]



            You can adjust your Stop based on previous candles. Just push a button and it will automatically adjust your level.

            Made a whole video to explain how to use but I time stamped the part that explains how to adjust the levels using the buttons:


            Again not 100% what you were looking for but may be helpful for quickly adjusting your orders.
            Thank you, I will download it and try it out. Basically I am looking to enter at a certain number of ticks above the previous candle's low (or the candle before that one). Is that possible?

            Comment


              #7
              Right now you can enter Long above the high of the selected candles +/- offset (Price, Percent or Ticks).
              Or Short below the low of the selected candles +/- offset

              If you are trying to enter 'Long' above the previous 'Low'. That is currently not an option. I may add it later as it's been requested a few times.
              But a bit of a work around for now would be to use the percentage entry offset. See the attached example:

              1. Recommend using Tick_Mode for this

              2. Offset will always select the Highest value. So you need to ensure this is lower so we select -99

              3. This will make the offset -100% of the range of your entry. So Entering Long will be at the bottom.
              (If you want a few ticks above the low, you can make it -0.75 or so. Won't be perfect but it will be a bit above the low.

              4. Same as 2. We are just making this less than the percentage offset.

              5. This just sets the stop to whatever Ticks below your position fill price. (Make this whatever you like)

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by jclose, Today, 09:37 PM
              0 responses
              5 views
              0 likes
              Last Post jclose
              by jclose
               
              Started by WeyldFalcon, 08-07-2020, 06:13 AM
              10 responses
              1,413 views
              0 likes
              Last Post Traderontheroad  
              Started by firefoxforum12, Today, 08:53 PM
              0 responses
              11 views
              0 likes
              Last Post firefoxforum12  
              Started by stafe, Today, 08:34 PM
              0 responses
              11 views
              0 likes
              Last Post stafe
              by stafe
               
              Started by sastrades, 01-31-2024, 10:19 PM
              11 responses
              169 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Working...
              X