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

Entries per direction

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

    Entries per direction

    I created a strategy through builder and I have a unique name when an order is placed. I have that unique name in stops and targets to set my stop and target. My question is, how can I place 2 separate orders if one is still open? Under properties, I've used different combos for entries per direction and entry handling but it will only still place one order at a time.

    #2
    Hello lbolton64,

    Thanks for your post.

    EntriesPerDirection and EntryHandling could be used to control the maximum number of entries allowed per direction while a position.

    If you set Entry Handling to EntryHandling.AllEntries, NinjaScript will process all entry order methods up to the maximum allowable entries set in the EntriesPerDirection property. For example, if you set EntriesPerDirection to 2 and use EntryHandling.AllEntries, up to a total of 2 entry orders will process.

    If you set Entry Handling to EntryHandling.UniqueEntries, NinjaScript will process order entry methods up to the maximum allowable entries set by the EntriesPerDirection property for each uniquely named entry. For example, if you have two entry order methods using unique signal names ("entry1" and "entry2"), set EntriesPerDirection to 2, and use EntryHandling.UniqueEntries, a maximum number of 2 entry orders will process for each uniquely named entry order (up to 2 orders for "entry1" and 2 orders for "entry2").

    See the help guide documentation below for more information.

    EntriesPerDirection: https://ninjatrader.com/support/helpGuides/nt8/NT HelpGuide English.html?entriesperdirection.htm

    EntryHandling: https://ninjatrader.com/support/helpGuides/nt8/NT HelpGuide English.html?entryhandling.htm

    Let us know if we may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Thank you for the reply. Does the 'start behavior' or 'stops and targets' section have anything to do with if it takes more than one order?

      Comment


        #4
        Hello lbolton64,

        Thanks for your notes.

        The 'Start Behavior' setting and the 'Stops and Targets' screen of the Strategy Builder do not dictate if the strategy places more than a certain number of orders per direction.

        This would be handled by the Entries Per Direction and Entry Handling properties as mentioned in post # 2.

        The Start Behavior setting determines how the strategy will behave on startup.

        The 'Stops and Targets' screen of the Strategy Builder would be used to set up stops and targets for a Strategy Builder strategy.

        See the help guide documentation below for more information.

        Start Behaviors: https://ninjatrader.com/support/help..._positions.htm

        Stops and Targets Screen: https://ninjatrader.com/support/help...er_screens.htm
        Brandon H.NinjaTrader Customer Service

        Comment


          #5
          I found out why it wasn't working. I had a statement in the algorithm that was preventing it from taking more than one trade at a time. After testing it without that statement, it worked for 'all entries' and 'unique entries'. What's the benefit of having it set to unique entries? Is it useful if you have more than one strategy with different names so you can differentiate between the two?

          Comment


            #6
            Hello lbolton64,

            Thanks for your notes.

            EntryHandling.UniqueEntries should be used if you have multiple entry orders being placed with unique signal names.

            This would allow the strategy to submit orders for each entry order using a unique signal name up to the amount set in the EntriesPerDirection property.

            For example, if you have two entry order methods using unique signal names ("entry1" and "entry2"), set EntriesPerDirection to 2, and use EntryHandling.UniqueEntries, a maximum number of 2 entry orders will process for each uniquely named entry order (up to 2 orders for "entry1" and 2 orders for "entry2").

            See the help guide documentation linked in post # 2 for more information.

            Note that a NinjaScript strategy cannot see orders placed by another NinjaScript strategy. The strategy can only see orders placed by that specific instance of the strategy.
            Brandon H.NinjaTrader Customer Service

            Comment


              #7
              Ok thank you. While backtesting will multiple orders process?

              Comment


                #8
                Hello lbolton64,

                Thanks for your notes.

                If the strategy is programmed to place multiple orders then yes, multiple orders would be calculated when running a backtest in the Strategy Analyzer.

                Backtesting a Strategy Help Guide: https://ninjatrader.com/support/help...a_strategy.htm
                Brandon H.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by AaronKoRn, Today, 09:49 PM
                0 responses
                6 views
                0 likes
                Last Post AaronKoRn  
                Started by carnitron, Today, 08:42 PM
                0 responses
                8 views
                0 likes
                Last Post carnitron  
                Started by strategist007, Today, 07:51 PM
                0 responses
                9 views
                0 likes
                Last Post strategist007  
                Started by StockTrader88, 03-06-2021, 08:58 AM
                44 responses
                3,975 views
                3 likes
                Last Post jhudas88  
                Started by rbeckmann05, Today, 06:48 PM
                0 responses
                9 views
                0 likes
                Last Post rbeckmann05  
                Working...
                X