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.
        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 algospoke, 04-17-2024, 06:40 PM
          6 responses
          48 views
          0 likes
          Last Post algospoke  
          Started by arvidvanstaey, Today, 02:19 PM
          4 responses
          11 views
          0 likes
          Last Post arvidvanstaey  
          Started by samish18, 04-17-2024, 08:57 AM
          16 responses
          61 views
          0 likes
          Last Post samish18  
          Started by jordanq2, Today, 03:10 PM
          2 responses
          9 views
          0 likes
          Last Post jordanq2  
          Started by traderqz, Today, 12:06 AM
          10 responses
          21 views
          0 likes
          Last Post traderqz  
          Working...
          X