• 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

built-in order safeguards

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

  • boaza
    started a topic built-in order safeguards

    built-in order safeguards

    Hi,
    I just got the following message:

    **NT** A BuyToCover stop order placed at '12/07/2011 22:01:00' has been ignored since the stop price is less than or equal to the close price of the current bar. This is an invalid order and subsequent orders may also be ignored. Please fix your strategy.
    I understand the violation, and its a very good thing NT catches this.
    My question is where I can find the set of rules by which NT determines that an order is invalid?
    I would like to problematically check for those before sending any orders.

    Many thanks,
    Boaz

  • NinjaTrader_RyanM1
    replied
    boaza, if you want to use CalculateOnBarClose = false, this would be tick by tick simulation. It's your script design that dictates whether you would set this true / false.

    Storing a value from OnMarketData() should not contribute to a significant performance hit.

    Leave a comment:


  • boaza
    replied
    Thanks Bertrand,
    • By 'Simulation' I mean that currently I only simulate bar data. Is there a way I can avoid going to tick-by-tick simulation?
    • As for storing the last bid/ask in OnMarketData() - any idea how would this effect execution performance in real time?

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    boaza, I'm not sure what exactly you mean with your simulator question - for the Bid / Ask values to compare it would be best if you stored them in OnMarketData() to variables which you would refer to in your OnExecution() then, those would hold then the last known bid / ask events.

    Leave a comment:


  • boaza
    replied
    Bertrand,

    Using 'CalculateOnBarClose = false' is currently too big a shift for me.
    I'm sending the stop order not in OnBarUpdate(), but in OnExecution(), as demonstrated here.
    • Can I still access the GetCurrentBid() and GetCurrentAsk() methods in OnExecution, even though 'CalculateOnBarClose = true'?
    • How would the simulator behave in this case?

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    I'm assuming that by 'above the current market', you mean that for Sell stop orders, the stop price must be below the current bid, whereas for Buy stop orders, the price has to be above the current ask. Is that correct?
    Correct, the inside market is the reference.

    As for working with 'CalculateOnBarClose = false' - are there any implications besides having to shift indices of indicators by one? Can I still use multi-time frames?
    Yes MultiTimeFrames can still be used, however of course indices used must be adapted as you already noted.

    Leave a comment:


  • boaza
    replied
    Bertrand,

    I'm assuming that by 'above the current market', you mean that for Sell stop orders, the stop price must be below the current bid, whereas for Buy stop orders, the price has to be above the current ask. Is that correct?

    As for working with 'CalculateOnBarClose = false' - are there any implications besides having to shift indices of indicators by one? Can I still use multi-time frames?

    Thanks,
    Boaz

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    Boaz, limit orders can be marketable yes.

    Stop orders need to be valid, meaning for a buy stop order it has to be placed above the current market or else it would be rejected.

    For your scripts, work with CalculateOnBarClose = false and use GetCurrentBid / Ask for example, for logic to be executing on the close of the bar only, place it in FirstTickOfBar.

    http://www.ninjatrader.com/support/f...ad.php?t=19387

    Leave a comment:


  • boaza
    replied
    Bertrand,
    I'd be happy if you could elaborate:
    1. What do you mean by 'fits as needed'? What are the legal/illegal boundaries for stop loss orders in live and in simulation?
    2. Is it possible to access the current bid/ask prices in live, while the strategy has CalculateOnBarClose is true?
    3. Are there any corresponding rules for Limit orders? Is it valid to place 'marketable' limit orders, namely orders which can be filled immediately?


    Thanks,
    Boaz

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    Boaz, you would need to check your stop orders against the current inside market (bid / ask) to ensure the order price fits as needed and would not be rejected. If you like to deal with rejections liks those in your code, then the realtime error handling could be turned off (http://www.ninjatrader.com/support/h...orhandling.htm)

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by alfonso, Today, 10:21 AM
0 responses
1 view
0 likes
Last Post alfonso
by alfonso
 
Started by saeed, Today, 10:20 AM
2 responses
4 views
0 likes
Last Post NinjaTrader_RyanS  
Started by ntbone, Yesterday, 05:21 PM
1 response
5 views
0 likes
Last Post NinjaTrader_ChelseaB  
Started by ntbone, Yesterday, 04:05 PM
1 response
5 views
0 likes
Last Post NinjaTrader_Jesse  
Started by tonynt, Today, 09:35 AM
1 response
12 views
0 likes
Last Post NinjaTrader_ChrisL  
Working...
X