• 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

When in the process of an algo do stops get tested and actioned?

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

    When in the process of an algo do stops get tested and actioned?

    Hi,

    In OnBarUpdate(), an algo checks for entry signals and then updates a trailing stop value if applicable and in OnExecution() the algo handles the entry and sets the initial stop prices. If we get an entry signal and an entry is executed with the stop set, where in the steps of the algo does a stop get tested and eventually actioned? Does the stop get implicitly tested in OnBarUpdate prior to any of the code in OnBarUpdate? And if the stop is to be actioned, does the code move to OnExecution to do this and then back to OnBarUpdate to continue looping over each bar?

    Thanks,
    darmbk.

    #2
    Hi Darmbk,

    Thank you for your post.

    The OnBarUpdate() will finish processing the code int the method before the code in the OnExection() is then called and tested.

    Example - In an OnBarUpdate(), halfway through the code an order gets submitted and filled. The filled calls the OnExecution, however the OnBarUpdate() will finish process the rest of the code in the method before testing the OnExecution code.

    Let me know if this if the answer you are looking for.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Thanks for your response.

      If OnExecution is called after OnBarUpdate, what is the difference between handling new entries and their stops at the start of the next OnBarUpdate rather than during OnExecution? What would you most usually code to occur during OnExecution that can't be done during OnBarUpdate?

      Cheers,
      darmbk.

      Comment


        #4
        The OnExecution will allow you to pass different parameters from the IExection to test against. This also allows you to utilize the IOrder class as well and be able to tell when your execution gets filled, part filled and so forth.

        Below is a link on IExection -
        http://www.ninjatrader.com/support/h...iexecution.htm
        Cal H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by TheGameOfProbabilities, 07-18-2019, 06:56 AM
        7 responses
        35 views
        0 likes
        Last Post DaveS
        by DaveS
         
        Started by scfnkysx, Today, 12:30 AM
        0 responses
        4 views
        0 likes
        Last Post scfnkysx  
        Started by jimloforkocv, Today, 12:16 AM
        0 responses
        4 views
        0 likes
        Last Post jimloforkocv  
        Started by claxxical, Yesterday, 10:00 PM
        0 responses
        8 views
        0 likes
        Last Post claxxical  
        Started by ct, Yesterday, 08:13 PM
        0 responses
        9 views
        0 likes
        Last Post ct
        by ct
         
        Working...
        X