• 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

working orders and On Bar Update

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

    working orders and On Bar Update

    I wrote a strategy that with a price condition set inside OnBarUpdate(), and place the trade inside OnMarketData(MarketDataEventArgs e), it works fine but the problem that I have is that once the working order is place, the OnBarUpdate() checks if the price change on every bar update (of course) if the price change my strategy cancel the previous working order and place a new working order with the new entry price but the problem is here: if the entry price stay the same the strategy does the same, cancel the current working order and place a new one with the same entry price, how can I do to prevent this happening, because sometimes market is too fast that ninja trader sent me and error because the order was misplace.

    #2
    Hello manuelmaldonado,

    If I am understanding you correctly, you want NinjaTrader to not cancel out your old order and keep your original entry price the same.

    If so, then you may use an IOrder to make sure that your orders is not already placed so that NinjaTrader will not change the price of your entry order. Here is an example of this that you may view.
    http://www.ninjatrader.com/support/h...tml?iorder.htm

    Another item that you may run into is that if your order is not filled by the end of the OnBarUpdate() NinjaTrader will cancel the order. To prevent this you may use the Advanced Order Handling approach to keep this order alive. Here is an example of how to keep an order a live even if it is not filled within the next OnBarUpdate().
    http://www.ninjatrader.com/support/f...ad.php?t=19169

    Let me know if you have any questions.
    JCNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by ajay8000, Yesterday, 11:31 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Marco  
    Started by simjs, Yesterday, 11:23 PM
    0 responses
    5 views
    0 likes
    Last Post simjs
    by simjs
     
    Started by akuntysh, Yesterday, 10:41 PM
    0 responses
    4 views
    0 likes
    Last Post akuntysh  
    Started by Wolf1, Yesterday, 08:26 PM
    0 responses
    7 views
    0 likes
    Last Post Wolf1
    by Wolf1
     
    Started by pparmley, Yesterday, 04:30 PM
    0 responses
    9 views
    0 likes
    Last Post pparmley  
    Working...
    X