Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order Fill Resolution = High and log messages dont make sense

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

    Order Fill Resolution = High and log messages dont make sense

    Hello,
    Can you pls explain why I get this error on the log when I`m backtesting a strategy using Order Fill Resolution = HIGH, Type = Minute and Value = 1.

    01-04-2016 15:30:00 SL=17020 Ask=16912 Bid=16912 Close=16912
    Strategy 'AuSBreakOut/-1': A Sell stop order placed at '1/4/2016 3:30:00 PM' 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.


    The backtest was on YN ##-## and I printed the values of the SL price along with the current ASK, BID and Close[0] prices.

    The statement that has this error is:

    double dblStopPrice = Instrument.MasterInstrument.RoundToTickSize(execut ion.Order.AverageFillPrice - ((double)IntInitialRiskTicks * TickSize));
    stopOrder = ExitLongStopMarket(0, true, execution.Order.Filled, dblStopPrice , cstrSignalName_SL, cstrSignalName_BuyStop);


    The strategy only receives this one log error, yet successfully completes several other trades without any log entries.

    Also, the strategy has no log errors when it is executed using Order Fill Resolution = Standard.

    What Close price is NT talking about when it says my stop price is less than or equal to a the close price of the current bar ?

    The stop price is 17020 and Close[0] = 16912.

    Thanks

    #2
    Hi rayko,

    The error indicates a sell stop was placed below the current price.

    Is this a simple strategy that I may test on my end?

    If not, can you make a simplified example strategy that I may test?

    To export a NinjaTrader 8 NinjaScript do the following:
    1. Click Tools -> Export -> NinjaScript...
    2. Click the 'add' link -> check the box(es) for the script(s) you want to include
    3. Click the 'Export' button
    4. Enter a unique name for the file in the value for 'File name:'
    5. Choose a save location -> click Save
    6. Click OK to clear the export location message

    By default your exported file will be in the following location:
    • (My) Documents/NinjaTrader 8/bin/Custom/ExportNinjaScript/<export_file_name.zip>


    Below is a link to the help guide on Exporting NinjaScripts.
    Last edited by NinjaTrader_ChelseaB; 03-31-2016, 12:16 PM.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello ChelseaB

      Actually its one that I use all the time and it is "precious" to me, and I can`t share it.

      This error only happens on the FIRST trade of the strategy backtest. I`ve tested various different trade date ranges and it always happens on the first trade.

      What Close price is NT talking about when it says my stop price is less than or equal to a the close price of the current bar ?

      Is it referring to the primary series of the chart Close[0], or is it the close of the 1 min bar that its using for Order Fill Resolution = HIGH, Type = Minute and Value = 1 ?

      Comment


        #4
        Hello rayko,

        Please create a simplified script that is able to demonstrate the behavior but does not include any code that is not directly necessary to reproduce the behavior.

        This would be a simple entry that places the order at the price. I would like to see if I can reproduce.

        You should also print the values all in one print and post your prints in this thread. So one line before the order is submitted the variable that contains the stop price and the current price are printed so we can compare the prices.


        The Close price is the close of which ever bar the order is being submitted from. (Every bar has an open, high, low, and close price. The error is saying that your sell stop order is below the close of that bar.)

        I look forward to receiving the example script.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Jon17, Today, 04:33 PM
        0 responses
        1 view
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        4 views
        0 likes
        Last Post Javierw.ok  
        Started by timmbbo, Today, 08:59 AM
        2 responses
        10 views
        0 likes
        Last Post bltdavid  
        Started by alifarahani, Today, 09:40 AM
        6 responses
        41 views
        0 likes
        Last Post alifarahani  
        Started by Waxavi, Today, 02:10 AM
        1 response
        20 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Working...
        X