Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem with orders

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

    Problem with orders

    In my trading system I've buy/sell limit orders and only a stoploss and a takeprofit once the position is established.
    So I expect to see only one order to buy or to sell and this is what usually happens on the system. The strange thing is that sometime it appears another order (close position, as you can see in the attachment) that duplicates my entry order without any reason.
    What is the close position that is not in the code?

    If you need I can send the full code in a private message.
    Thanks.

    Attached Files

    #2
    imported post

    Max,

    Send me privately the code and an image of the strategy dialogue window when applying the strategy to a chart. Also let me know the time frame (10 tick I think) and if this can be reproduced in backtest or only live trading. Thanks.
    RayNinjaTrader Customer Service

    Comment


      #3
      imported post

      Max,

      After further review, the strategy is operating as designed. I will add some information to the documentation laterdown the road to better explain this.

      For example:

      Lets say your strategy is currently long and you have a stop and target working in the market.

      Your strategy now generates a sell limit entry order. So you now have three working orders, stop/target to exit long position and a sell limit entry.

      A) If the sell limit entry is filled, NT will cancel the stop/target and issue a "CLOSE" order to close the long position.

      B) If the stop is filled, NT will cancel the target and leave your pending sell limit entry working

      C) If the target is filled, NT will cancel teh stop and leave your pendign sell limit entry working

      Hope that makes sense. If you are looking for a different behaviour, please let me know and I can provide some suggestions.

      One tip: You do not need to check for market position since the method EnterLongLimit() already does that for you internally. If a long position already exists, this method just returns.

      Ray
      RayNinjaTrader Customer Service

      Comment


        #4
        imported post

        Thanks for the explanation.

        Code:
        One tip: You do not need to check for market position since the method EnterLongLimit() already does that for you internally. If a long position already exists, this method just returns.
        Does this avoid to re-enter on the same bar if the position has been stopped out?

        Thanks.

        Comment


          #5
          imported post

          Yes it would avoid re-entry on the same bar if your strategy is running with the property "Calculate on bar close = true". If set to false, system is evaluated tick by tick and signals can generate on the same bar.

          Additional information: The properties "Entries per direction" and "Entry handling" control the internal logic of the Enter() methods.

          Example 1:

          Entries per direction = 1
          Entry handling = AllEntries

          Then EnterLongLimit() will be ignored if a long position already exists or if another entry order is pending.

          Example 2:

          Entries per direction = 1
          Entry handling = UniqueEntries

          Then EnterLongLimit() will be ignored if a long position already exists that was entered with the same signal name. So if you call the method twice each with unique signal name, then two entry orders can be generated.


          Ray
          RayNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by rtwave, 04-12-2024, 09:30 AM
          2 responses
          20 views
          0 likes
          Last Post rtwave
          by rtwave
           
          Started by tsantospinto, 04-12-2024, 07:04 PM
          5 responses
          67 views
          0 likes
          Last Post tsantospinto  
          Started by cre8able, Today, 03:20 PM
          0 responses
          6 views
          0 likes
          Last Post cre8able  
          Started by Fran888, 02-16-2024, 10:48 AM
          3 responses
          49 views
          0 likes
          Last Post Sam2515
          by Sam2515
           
          Started by martin70, 03-24-2023, 04:58 AM
          15 responses
          115 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X