Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EnterShortLimit

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

    EnterShortLimit

    Just getting to grips with managed order methods and OnOrderUpdate events, really good but I just need a little clarification ...

    I have a simple strategy (calculate on each tick) that calls EnterShortLimit(3684.50) on a 1 minute historical bar with high = 3685.75 and low = 3683.00

    but it gets filled on the low of the next bar at 3684.35

    Any ideas?


    ​also get trace output "An Enter() method to submit an entry order at '14/10/2022 16:03:00' has been ignored. Please search on the term 'Internal Order Handling Rules that Reduce Unwanted Positions' in the Help Guide for detailed explanation". But I can't find it in the help guide?
    Last edited by dibDab; 10-19-2022, 09:35 AM.

    #2
    Hi dibDab, thanks for posting. Please make sure to enable Tick Replay for the historical calculation of the OnEachTick strategy so the indicators and price movement can be better calculated. Strategy backtests will always run OnBarClose, so if you would like better fill estimation, you can also go into the Strategy's settings and set Order Fill Resolution to High>1 Tick or 1 second to get better intrabar price movement. Further reading on intrabar granularity is linked in a similar forum post below:


    Documentation on enabling and using Tick Replay:


    The order handling rules can be found here:


    If you are getting this, it means one of the rules under "Methods that generate orders to enter a position will be ignored if:" is being broken, or it's from historical overfill which should be resolved by adding intrabar granularity.


    Please let me know if this does not resolve.

    Kind regards,
    -ChrisL

    Comment


      #3
      Historal Order Fill Resolution = Standard

      EnterLonglimit @ 3606.5 on bar 00:22 with High 3607.7 and Low is 3604.5
      trace: Entered internal SubmitOrderManaged() method at 17/10/2022 00:22:00: BarsInProgress=0 Action=Buy OrderType=Limit Quantity=1 LimitPrice=3606.50 StopPrice=0 SignalName='Enter Long Limit'
      chart signal: "Enter Long Limit 1 @ 3606.5" on bar 00:23 with High 3607.7 and Low is 3606

      EnterLonglimit @ 3606 on bar 00:22 with High 3607.7 and Low is 3604.5,
      trace: Entered internal SubmitOrderManaged() method at 17/10/2022 00:22:00: BarsInProgress=0 Action=Buy OrderType=Limit Quantity=1 LimitPrice=3606.00 StopPrice=0 SignalName='Enter Long Limit'
      chart signal: not displayed

      Historal Order Fill Resolution = High 1 Second

      EnterLonglimit @ 3606.5 on bar 00:22 with High 3607.7 and Low is 3604.5
      Trace: Entered internal SubmitOrderManaged() method at 17/10/2022 00:22:00: BarsInProgress=0 Action=Buy OrderType=Limit Quantity=1 LimitPrice=3606.50 StopPrice=0 SignalName='Enter Long Limit'
      chart signal: "Enter Long Limit 1 @ 3606.00" on bar 00:23 with High 3607.7 and Low is 3606

      EnterLonglimit @ 3606 on bar 00:22 with High 3607.7 and Low is 3604.5,
      trace: Entered internal SubmitOrderManaged() method at 17/10/2022 00:22:00: BarsInProgress=0 Action=Buy OrderType=Limit Quantity=1 LimitPrice=3606.00 StopPrice=0 SignalName='Enter Long Limit'
      chart signal: not displayed

      getting a bit complicated so to summarize:

      the trace appears to give an accurate description since the longlimit should be set @ 3606 on bar 00:22
      if I set isLiveUntilCancelled the chart signal displays "Enter Long Limit 1 @ 3606.00" on bar 00:25​
      Last edited by dibDab; 10-20-2022, 07:59 AM.

      Comment


        #4
        Hi dibDab, thanks for the follow-up. With isLiveUntilCancelled = false the order will be canceled at the close of the bar unless it's resubmitted at the next bar. Turing this to true will keep the order alive until CancelOrder() is called or until it's filled. Please also make sure to enable Tick Replay to accurately calculate the price and indicator conditions your strategy is using.

        Kind regards,
        -ChrisL

        Comment


          #5
          ok thanks. that worked (although performance is not great).

          The trace always works. Is the trace operating differently to the chart signal? If possible it would be useful to understand?

          Is this issue related to Historical Fill Prices?
          Last edited by dibDab; 10-20-2022, 12:15 PM.

          Comment


            #6
            Hi, thanks for the follow up. Could you reproduce this with a simple strategy and post screen shots? The log should be showing the same data since the strategy is relaying the execution price to the log.

            Kind regards,
            -ChrisL

            Comment


              #7
              ok will put something together over the weekend but I'm pretty sure the chart signal is not on the same bar as the trace at least on the setup I'm testing?
              Attached Files

              Comment


                #8
                Hi, thanks for posting that. The timestamps you get on the chart are going to depend on the time series you have selected. E.g. If this is a 5 minute chart it will only print a timestamp every 5 minutes so you would not see a :22 time stamp. The :22 time stamp in the log is coming from the added data series used to calculate order fills.

                Kind regards,
                -ChrisL

                Comment


                  #9
                  ok but I'm testing this on a 1 minute chart

                  Comment


                    #10
                    Hello dibDab,

                    Is the script running with Calculate set to OnBarClose?

                    Is your PC Clock synchronized to internet time within 1 second?
                    Chelsea B.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by NullPointStrategies, Yesterday, 05:17 AM
                    0 responses
                    64 views
                    0 likes
                    Last Post NullPointStrategies  
                    Started by argusthome, 03-08-2026, 10:06 AM
                    0 responses
                    139 views
                    0 likes
                    Last Post argusthome  
                    Started by NabilKhattabi, 03-06-2026, 11:18 AM
                    0 responses
                    75 views
                    0 likes
                    Last Post NabilKhattabi  
                    Started by Deep42, 03-06-2026, 12:28 AM
                    0 responses
                    45 views
                    0 likes
                    Last Post Deep42
                    by Deep42
                     
                    Started by TheRealMorford, 03-05-2026, 06:15 PM
                    0 responses
                    50 views
                    0 likes
                    Last Post TheRealMorford  
                    Working...
                    X