Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

When does order submit?

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

  • koganam
    replied
    Originally posted by elitetradernyc View Post
    Koganam, thanks for your response, but this is my concern about limit orders. I heard that with Limits, if you miss the price, then it may move away from you, and this would make backtesting with limit orders useless because it does not mimic what would happen if you missed the limit. Am I correct or no?

    Thanks,
    EliteTraderNYC
    That is the point that I made. In a fast moving market Limit Orders might not get filled, because the market will simply not retreat to put one in. That is the price of efficient entry. To me, it does not matter: trades are like buses; if you miss one, there will be another along soon enough. I would rather be out of a trade wishing that I were in, than in a trade wishing that I were out, which is often the case if you get very large slippage with a market order. I have seen /TF jump 1 full point between updates, meaning potentially at least $100/contract slippage on a market order in such a case.

    The second thing is that you probably should not put so much store in backtest. They do not need to be as accurate as you seem to want for a very simple reason.

    The only real/valid use of a backtest is to answer the question: "Given perfect knowledge of the future, would my system have made money?". In other words, you use a backtest to decide if you need to do further investigation towards using the system, because if the system cannot make money in backtest, there is a probability, bordering on certainty, that the system cannot make money in real time.

    Given that aegis, what does it really matter if a few trades are not taken because the market does not retreat. If that is the case, that is what would have happened in reality anyway, so that is all to the good. Of course, you can switch to Market Orders, but in fact, in backtest, Market Orders will probably underestimate slippage, relative to reality, and will actually give you results which are likely more deceptive.

    Leave a comment:


  • elitetradernyc
    replied
    Lets say hypothetically the broker doesn't fill your order, is that simulatable? whats the solution?

    Leave a comment:


  • NinjaTrader_JC
    replied
    Hello EliteTraderNYC,

    By miss the price, do you mean that the price did not touch our order or are you referring to as a broker did not fill your order?

    Leave a comment:


  • elitetradernyc
    replied
    Koganam, thanks for your response, but this is my concern about limit orders. I heard that with Limits, if you miss the price, then it may move away from you, and this would make backtesting with limit orders useless because it does not mimic what would happen if you missed the limit. Am I correct or no?

    Thanks,
    EliteTraderNYC

    Originally posted by koganam View Post
    Limit orders by definition and execution have only no slippage or favorable slippage. If you want efficient entry, use Limit orders at the price that you want to enter. The downside, is that in a sudden surge, your entry may never be filled.

    Leave a comment:


  • NinjaTrader_JC
    replied
    Hello nailz420,

    Yes, you may add intrabar granularity to help with your fills Historically as well.

    Leave a comment:


  • nailz420
    replied
    What about adding a secondary period (1 tick/1 range) and submitting orders on that period?

    Leave a comment:


  • NinjaTrader_JC
    replied
    Hello elitetradernyc,

    Yes, you may want to do as koganam suggested and use Limit orders.

    When backtesting keep in mind that the fill prices are going to be determined based on the OHLC of a bar and the Fill type selected. If you want a more expected fill price using a limit order with a specific price, you may use a Fill type to get the result.

    The two Fill types are Default, and Liberal:

    Default- An algorithm that takes a conservative and more realistic approach to filling limit and stop limit orders.

    * Limit orders only fill if the limit price was penetrated

    * Limit orders are always filled at the limit price specified never better (for example, if a limit order is submitted on bar n, NinjaTrader will check if the order is filled on bar n+1, if this bar gaps down and the limit order was a buy, the order would be filled at the limit price and NOT the high of bar n+1)

    Liberal - An algorithm that takes a liberal approach to filling limit and stop limit orders.

    * Limit orders fill if the limit price was touched

    * On gap down bars, buy limit orders will fill at the high of the gap down bar

    * On gap up bars, sell limit orders will fill at the low of the gap up bar

    For more information about historical Fill types you may read the following link.

    http://www.ninjatrader.com/support/h...a_strategy.htm

    Leave a comment:


  • koganam
    replied
    Originally posted by elitetradernyc View Post
    Thanks for the information. Do you have any tips for avoiding slippage for my scripts for ES executions? I want to make them as efficient as possible.
    Limit orders by definition and execution have only no slippage or favorable slippage. If you want efficient entry, use Limit orders at the price that you want to enter. The downside, is that in a sudden surge, your entry may never be filled.

    Leave a comment:


  • elitetradernyc
    replied
    Thanks for the information. Do you have any tips for avoiding slippage for my scripts for ES executions? I want to make them as efficient as possible.

    Leave a comment:


  • NinjaTrader_JC
    replied
    Hello EliteTraderNYC,

    NinjaTrader is an event driven so your EnterLong call would happen after the end of the OnBarUpdate() method. Using CalculateOnBarClose set to true OnBarUpdate() will be called at the end of the bar so the order will be submitted after OnBarUpdate() finishes processing.

    Happy to be of further assistance.

    Leave a comment:


  • elitetradernyc
    started a topic When does order submit?

    When does order submit?

    Hey guys, in efforts to avoid slippage I was curious to know how soon an order would submit within a script. For example, if you have a long script with an "Enterlong" statement in the middle of the code, would the order submit at the point the script hits that line, or does it submit at the end of the BarUpdate code? Assuming that CalculateonBarClose=true.

    Thanks,
    EliteTraderNYC

Latest Posts

Collapse

Topics Statistics Last Post
Started by HTrader, Yesterday, 09:12 PM
2 responses
12 views
0 likes
Last Post HTrader
by HTrader
 
Started by firstlanetech, Yesterday, 08:56 PM
1 response
4 views
0 likes
Last Post NinjaTrader_ChelseaB  
Started by robbersdog, Yesterday, 07:55 AM
1 response
8 views
0 likes
Last Post NinjaTrader_ChelseaB  
Started by SuperDude123, Yesterday, 09:08 AM
2 responses
42 views
0 likes
Last Post SuperDude123  
Started by trader3000a, Yesterday, 08:01 AM
1 response
7 views
0 likes
Last Post NinjaTrader_ChelseaB  
Working...
X