• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EnterLongLimit execution

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

    EnterLongLimit execution

    Hello!
    Help me, please, to understand.
    I've made a strategy in which opens positions with EnterLongLimit order.The strategygenerates signals on bar is closed. However, in the strategy tester (see attached screen)</SPAN>, when the strategy sends limit order, the position's enter occurs exactly at a given limit level (green line on the screen)</SPAN>even if the given level is more thancurrent candle opens. Why is this so? Is not the </SPAN>limit order should be executed at the best price? And in this situation the open price is better than the limit price.
    Attached Files
    Last edited by Lifat; 06-30-2017, 12:36 PM.

    #2
    Hello Lifat,

    Thank you for your note.

    Without the full code we're unable to test on our end.

    If you'd like to upload the full code I can take a look and see if anything jumps out. Or if you'd prefer to email a copy, send to platformsupport[at]ninjatrader[dot]com with Attn: Alan P in the Subject line. Also within the email please include a link to this thread, and the files.

    I look forward to your reply.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Hello, NinjaTrader_AlanP! Thank You for quick replay!

      ///////////////////////////////////////////////////////////////

      Hello, NinjaTrader_AlanP! Thank You for quick replay!

      Here it is the code in the attached file. The code is very simple.

      I've got the limit level as value of my custom indicator and than need to close a position by stop loss order on another level - a value of the indicator.
      Attached Files
      Last edited by Lifat; 06-30-2017, 12:41 PM.

      Comment


        #4
        In addition the indicators I use
        Attached Files

        Comment


          #5
          Hello Lifat,

          Was the fill in question in real time, backtest, or historical fill?

          I look forward to your reply.
          Alan P.NinjaTrader Customer Service

          Comment


            #6
            AlanP, I use historical minute data loaded from TXT file on backtest. And the strategy is testing in strategy analyzer on minute bars as well.
            Last edited by Lifat; 07-01-2017, 01:49 AM.

            Comment


              #7
              Hello,

              When using backtesting the strategy will run exactly the same as if CalculateOnBarClose is set to true. This is true whenever the strategy runs on historical type data. The reason for this is because the only info known historically is the Bar open, High, Low and close and not all of the ticks that make up the bar. You can also get extremely misleading results if you are using a bar that changes shape such as renko bar type as the finished bar does not show the true range of price movement.

              Please see Discrepancies: Real-Time vs Backtest section of our helpguide.
              https://ninjatrader.com/support/help...ime_vs_bac.htm

              Adding a secondary data series of a smaller time duration would allow your strategy to enter/exit intra bar and give you results closer to market replay.

              Please see Backtesting NinjaScript Strategies with an intrabar granularity for a reference example on how you’d set this up.
              http://ninjatrader.com/support/forum...ead.php?t=6652

              Please let us know if you need further assistance.
              Alan P.NinjaTrader Customer Service

              Comment


                #8
                AlanP, if "The reason for this is because the only info known historically is the Bar open, High, Low and close and not all of the ticks that make up the bar. ", then why limit order does not fill at open price if this price is better than limit level price? That's what i'm talking about.

                Comment


                  #9
                  Hello Lifat,

                  To achieve the behavior you desire you would need to add a secondary data series of type tick to correctly plot your intrabar fill. With a secondary series your limit order would have been filled better the limit price, giving you a more realistic result.
                  http://ninjatrader.com/support/forum...ead.php?t=6652

                  You may also try using High Order Fill resolution for which I’ve provided a link to below.
                  https://ninjatrader.com/support/help...ical_fill_.htm

                  Please let us know if you need further assistance.
                  Alan P.NinjaTrader Customer Service

                  Comment


                    #10
                    AlanP, thank you for the help! I'll try follow your recommendations.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by brunoviveiros, Today, 09:36 AM
                    1 response
                    17 views
                    0 likes
                    Last Post NinjaTrader_BrandonH  
                    Started by GARZONJ, Today, 11:22 AM
                    1 response
                    10 views
                    0 likes
                    Last Post NinjaTrader_Jesse  
                    Started by KonalGondal, Today, 10:18 AM
                    1 response
                    13 views
                    0 likes
                    Last Post NinjaTrader_Kate  
                    Started by Jorge.andres.o, Today, 09:24 AM
                    4 responses
                    21 views
                    0 likes
                    Last Post NinjaTrader_PaulH  
                    Started by Oracletrades, Today, 09:02 AM
                    5 responses
                    22 views
                    0 likes
                    Last Post Oracletrades  
                    Working...
                    X