• 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, EnterShortLimit not works

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

    EnterLongLimit, EnterShortLimit not works

    Hello,
    I'm trying to write multi-time-frame strategy to backtest and got problem with EnterLongLimit / EnterShortLimit functions.

    This strategy works with 2 time frames.
    1. 15 Minute period as primary
    2. 1 Day period as secondary

    My strategy calculate at the first bar of every day the price to get long (from Day period bars) and set orders by calling EnterLongLimit( price ) and vice versa.

    The problem is, that the order is executed immediately even if the price was not reached. This order is also executed by limit price and not by market price.

    Hope I explain this issue clearly.
    Thanks.
    Attached Files

    #2
    Hi dalisdj, can you please post your code so we can take a closer look?
    AustinNinjaTrader Customer Service

    Comment


      #3
      Hi Austin,
      here is your code. Btw I use 7.0.1000.7.
      Attached Files

      Comment


        #4
        dslisdj, have you tried using stop orders yet? From the description you've provided earlier along with your code, it looks like you're trying to place two orders at a high and low price and wait until those prices are hit before the order fills. Your limit orders would be filled immediately because the long limit is higher than the current market price and vice-versa for the short limit order.

        Please try with stop orders and let me know if you then get the expected behavior.
        http://www.ninjatrader.com/support/h...erlongstop.htm
        AustinNinjaTrader Customer Service

        Comment


          #5
          I see EnterLongLimit works differently than I expected. Changing to EnterLongStop make this code works according to my expectations.

          Thank you very much for solving this problem Austin.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by seagraph, Today, 03:27 PM
          0 responses
          11 views
          0 likes
          Last Post seagraph  
          Started by dedouglas, Today, 02:54 PM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by elkhatabi, 08-01-2019, 06:36 PM
          5 responses
          53 views
          0 likes
          Last Post NinjaTrader_RyanL  
          Started by mr_trade, Today, 01:01 PM
          4 responses
          19 views
          0 likes
          Last Post mr_trade  
          Started by Renorail, Today, 12:31 PM
          1 response
          14 views
          0 likes
          Last Post NinjaTrader_PaulH  
          Working...
          X