Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

built-in order safeguards

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

  • 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.

    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:


  • 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

Latest Posts

Collapse

Topics Statistics Last Post
Started by lightsun47, Today, 03:51 PM
0 responses
4 views
0 likes
Last Post lightsun47  
Started by 00nevest, Today, 02:27 PM
1 response
8 views
0 likes
Last Post 00nevest  
Started by futtrader, 04-21-2024, 01:50 AM
4 responses
44 views
0 likes
Last Post futtrader  
Started by Option Whisperer, Today, 09:55 AM
1 response
13 views
0 likes
Last Post bltdavid  
Started by port119, Today, 02:43 PM
0 responses
8 views
0 likes
Last Post port119
by port119
 
Working...
X