• 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 Jurase, Today, 06:47 PM
    2 responses
    5 views
    0 likes
    Last Post Jurase
    by Jurase
     
    Started by GTBrooks, Today, 05:53 PM
    0 responses
    1 view
    0 likes
    Last Post GTBrooks  
    Started by jeronymite, Today, 04:50 PM
    0 responses
    5 views
    0 likes
    Last Post jeronymite  
    Started by daigo1, Today, 04:41 PM
    0 responses
    14 views
    0 likes
    Last Post daigo1
    by daigo1
     
    Started by Harrylwd4, Today, 03:15 PM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Working...
    X