• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Question about trailing stops

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

    Question about trailing stops

    I am looking to have a setup for trailing stops that I get the feeling I will have to code on my own because it seems this logic doesn't exist at the broker level (my broker is IB).

    I want to set the stop for a losing position to be say 10 ticks, and I want a trailing stop for the winning position to be 10 ticks as well. But what happens is that if the position goes up 8 from time of entry, and then falls -2 below where I entered, it sees it as having fallen 10 from the high, and closes it -2 below. But my logic never wants to close when its down by less than 10.

    So will I have to code this by hand or is there a way to set up this order logic with Ninja Script and my broker's order types?

    #2
    Yes. Please see the reference sample for OnOrderUpdate() and OnExecution().
    JoshNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Josh View Post
      Yes. Please see the reference sample for OnOrderUpdate() and OnExecution().
      Is there an example specific to my question or do you mean those are the events I would use to handle this case? I guess I should be just issuing a stop loss and then doing my own exit at market when the price reaches a high and then falls below a threshold? Or are you talking about something else? Thx.

      Comment


        #4
        Go to the Reference Sample section of the forums and find the sample for OnOrderUpdate(). It will show you techniques that you can apply over to your case, but it is considered more advanced programming.
        JoshNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by n8dogg59, Today, 03:07 PM
        0 responses
        1 view
        0 likes
        Last Post n8dogg59  
        Started by Newtrader101, Today, 10:31 AM
        1 response
        15 views
        0 likes
        Last Post koganam
        by koganam
         
        Started by nepenthean, Today, 12:36 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by sun0781, Yesterday, 05:02 PM
        1 response
        23 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by Emma1, Today, 12:14 PM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Working...
        X