• 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 dyanemorye, Today, 01:45 AM
        0 responses
        2 views
        0 likes
        Last Post dyanemorye  
        Started by Bouzayen, Yesterday, 08:31 PM
        0 responses
        16 views
        0 likes
        Last Post Bouzayen  
        Started by IanC28, 03-27-2020, 10:20 AM
        6 responses
        32 views
        0 likes
        Last Post jim1234
        by jim1234
         
        Started by aramtrader, 04-01-2020, 03:05 PM
        7 responses
        44 views
        0 likes
        Last Post woodie1
        by woodie1
         
        Started by renehtx, Yesterday, 03:51 PM
        2 responses
        20 views
        0 likes
        Last Post renehtx
        by renehtx
         
        Working...
        X