Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

coding an entry and exit strategy

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

    coding an entry and exit strategy

    Hi NT people,

    I am quite new to NT and to programming as well, so please bear with me.

    I need to write a code that on entry is an OCO order and on exit is covered with an auto trail stop(effectively stuff thats contained in an ATM strategy). But on entry I would like my buy_stop_limit order to be 2 ticks above the bid and my sell_stop_limit order 2 ticks below the offer.

    Also would it be possible to manually adjust what time the entry to the trade should occur down to the last second, in hh:mm:ss format.

    Thanks for your help.

    Gametrader

    #2
    Hello GameTrader,

    Welcome to the NinjaTrader forums!

    This type of strategy requires working with the unmanaged order system. If you wanted to submit both short and long orders at the same time with a managed system, you run into Internal Order Handling rules and one of these orders is ignored.

    You can work with time objects that are accurate to the second. Bar time stamps are when the bar ends, and the granularity depends then on the series that you've applied the strategy to. With 15 minute bars, the time stamp is only changed every 15 minutes.

    You can also work with your computer date time if you want to place orders at a specific time. Help with Date / Time objects is covered in this sample here:
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Hi Ryan,

      Thanks for your reply and the information.

      So it is possible then for me the code my strategy in NT, which is good.

      I wonder if you could you please give me guidance on where to start.

      Thanks
      Gametrader

      Comment


        #4
        The strategy wizard is a good place to start. You can generate trade conditions in a point and click interface and view the code for it.


        If you're looking to develop the strategy in your first post, you will have to work with the unmanaged order system. Details on this are here:
        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        566 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        330 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        547 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        548 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X