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 judysamnt7, 03-13-2023, 09:11 AM
          4 responses
          59 views
          0 likes
          Last Post DynamicTest  
          Started by ScottWalsh, Today, 06:52 PM
          4 responses
          36 views
          0 likes
          Last Post ScottWalsh  
          Started by olisav57, Today, 07:39 PM
          0 responses
          7 views
          0 likes
          Last Post olisav57  
          Started by trilliantrader, Today, 03:01 PM
          2 responses
          21 views
          0 likes
          Last Post helpwanted  
          Started by cre8able, Today, 07:24 PM
          0 responses
          10 views
          0 likes
          Last Post cre8able  
          Working...
          X