Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 Stanfillirenfro, Today, 07:23 AM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by cmtjoancolmenero, Yesterday, 03:58 PM
        2 responses
        22 views
        0 likes
        Last Post cmtjoancolmenero  
        Started by olisav57, Yesterday, 07:39 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by cocoescala, 10-12-2018, 11:02 PM
        7 responses
        944 views
        0 likes
        Last Post Jquiroz1975  
        Started by oviejo, Today, 12:28 AM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X