• 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

Trying to cancel or modify existing orders on new bars.

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

    Trying to cancel or modify existing orders on new bars.

    I created a trading strategy that calls an ATM using the sample given in ninjatrader.

    The problem I have with this is it never cancels or modify's existing orders on each new bar like it does regularly with setstoploss.

    How can I fix this?

    #2
    Hello Aleehatami,

    Thank you for your post.

    It should call the ATM strategy, and then function the same as if you had ran the ATM strategy from a Superdom window for example. This means it will evaluate the settings specified in the ATM strategy and update (modify, cancel) accordingly.

    It can't access any orders created outside this context, however. So if you had added SetStopLoss() and SetProfitTarget() orders it will not be able to modify these.
    Ryan MNinjaTrader Customer Service

    Comment


      #3
      Ryan, how can I make it so that if a order is made and not filled by the start of a new bar it cancels the order and waits for a new one like it does normally with setstoploss?

      Here is a sample code that ends up having maybe 10 live orders at once because the orders are never canceled?
      Attached Files

      Comment


        #4
        Hello aleehatami,

        Your entry conditions are still true so it's setting orders. You're right that they do not autoexpire the same way set methods do.

        You will have to manually cancel the order if you don't want it active.

        http://www.ninjatrader-support.com/H...egyActive.html
        Ryan MNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by vhjscv, Yesterday, 10:31 PM
        0 responses
        8 views
        0 likes
        Last Post vhjscv
        by vhjscv
         
        Started by buick, Yesterday, 09:37 PM
        0 responses
        4 views
        0 likes
        Last Post buick
        by buick
         
        Started by Hagar, Yesterday, 07:12 PM
        0 responses
        6 views
        0 likes
        Last Post Hagar
        by Hagar
         
        Started by jtrading82, Yesterday, 01:55 PM
        4 responses
        28 views
        0 likes
        Last Post bppayne
        by bppayne
         
        Started by Hagar, Yesterday, 06:52 PM
        0 responses
        4 views
        0 likes
        Last Post Hagar
        by Hagar
         
        Working...
        X