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

limit orders

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

    limit orders

    Hi

    Can EnterLongLimit and EnterShortLimit orders be used for historical backtesting of a strategy?

    When I view them on a chart they all show entries based on the open of a bar.

    Thanks

    #2
    Hello fishbed,

    Yes, all order types including Market, Stop Market, Limit, and Stop Limit orders can be used. However, keep in mind when in historical data, only the Open, High, Low, an Close will be available and there will be no intra-bar data. This means fills will only occur after a bar has closed.

    See below about adding intra-bar granularity for intra-bar actions and intra-bar fills.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      limit orders continued

      Thanks for this ChelseaB

      Does this also apply with regards running the strategy in the Strategy Analyser?

      Regards

      Comment


        #4
        Hello fishbed,

        Yes, this would include backtesting with the Strategy Analyzer.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thanks Chelsea

          Comment


            #6
            Hi Chelsea

            Cannot use the link

            See below about adding intra-bar granularity for intra-bar actions and intra-bar fills.


            I get a "Not Authorised" message

            Comment


              #7
              RE:
              "Yes, all order types including Market, Stop Market, Limit, and Stop Limit orders can be used. However, keep in mind when in historical data, only the Open, High, Low, an Close will be available and there will be no intra-bar data. This means fills will only occur after a bar has closed."

              Does this mean the entry price will be the bar close and any limit order can only use the open/close values and not any intrabar value.

              Comment


                #8
                Hello fishbed,

                Are you clicking the link or copying and pasting the link?

                The link I have provided in post 2 does work, but is long and automatically shortened by the forum. You must click the link and not copy and paste the shortened url which contains the ellipses.

                The link in your post does not work, and appears to have been copied and pasted...
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Thanks, Link workded...

                  Comment


                    #10
                    Hello fishbed,

                    Yes, as indicated in the link I have provided, only the Open, High, Low, and Close are known of the bar and there is no intra-bar information. This means orders cannot fill with intra-bar information.
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #11
                      Hi Chelsea

                      Thank you for all the quick responses, I am just trying to make sure I understand how your backtesting tool works and if I see things that are discrepencies I would rather ask the question than pretend to understand. To this end, you mention the backtesting on historical entries is governed by the O,H,L,C prices on which a bar is constructed.

                      Also from your documents :
                      "The Standard setting creates virtual bars according to the following logic:

                      When the Open price of the bar is closer to the High price then the Low price:

                      1. Open price to the High price
                      2. High price to the Low price
                      3. Low price to the Close price"

                      Does this "virtual" created bar allow "virtual" intrabar values that are then used by the system?

                      I ask because our historical fills are showing entries that are NOT represented by the O,H,L,C values of the bar. But are more representetive of what we are wanting when using limit orders, ie if the limit entry order places the price above the market, 49.52 for a Buy, then we should get filled at market price or better. The bar may show O = 49.40, L = 49.30, H = 49.50, C = 49.45 and we get 49.42. We can look at it and go that is correct, but for your backtesting system is this scenario correct?

                      If it places the limit order below the market it waits for the price to come to it, again correct.

                      I have also attached an image of an historical entry showing this "intrabar" type entry on a limit order.

                      I hope the question is clear, but if you need anything else please let me know.

                      Thanks
                      Attached Files

                      Comment


                        #12
                        Hello fishbed,

                        Thank you for you response.

                        Limit orders will fill at the limit price, so if the High and Low support the limit price it would fill at that price.

                        Please let me know if you have any questions.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by kevinenergy, 02-17-2023, 12:42 PM
                        117 responses
                        2,765 views
                        1 like
                        Last Post jculp
                        by jculp
                         
                        Started by Mongo, Today, 11:05 AM
                        5 responses
                        15 views
                        0 likes
                        Last Post NinjaTrader_ChelseaB  
                        Started by SightCareAubetter, Today, 12:55 PM
                        0 responses
                        3 views
                        0 likes
                        Last Post SightCareAubetter  
                        Started by traderqz, Today, 12:06 AM
                        8 responses
                        16 views
                        0 likes
                        Last Post traderqz  
                        Started by SightCareAubetter, Today, 12:50 PM
                        0 responses
                        2 views
                        0 likes
                        Last Post SightCareAubetter  
                        Working...
                        X