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

Number of Entries Per Strategy

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

    Number of Entries Per Strategy

    Hello

    If I set multiple entry criteria and exit criteria in one strategy and set "entries per direction" to one will this ensure that only one entry happens even if there are subsequent signals.

    Example using strategy wizard...

    Strategy Set 1 SMA1 crosses above SMA2 = enter long "SMA Entry"
    Strategy Set 2 SMA1 crossed below SMA2 = exit long position "SMA Exit"

    Strategy Set 3 Close crosses above lower Bollinger band = enter long "BB Entry"
    Strategy Set 4 Close equals upper Bollinger band = exit long position "BB Exit"

    Basic question if I am in a position from strategy Set 1 "SMA Entry" with "Entries per direction" set to one will that prevent an entry if a signal fires from Strategy Set 3 "BB Entry"

    Thank you

    Stefan

    #2
    Hello sdauteuil,

    Thanks for your post.

    In general yes. Setting Entries Per direction to 1 and the complementary setting of EntryHandling to all entries would prevent more entries that specified and entry orders when would be ignored when you are in position. Exceptions to this would be if you are using a mode other than Calculate.OnBarClose or are using extremely fast building bars.
    References:



    You can also add a check of the current market position to each of your entry sets so that you only place an entry order when you are in a "Flat" position, please see, " How to create market position comparisons " in: https://ninjatrader.com/support/help...on_builder.htm

    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thank you

      Does setting the market position to flat relate only to the current strategy or any open position that instrument. Let's say I entered a discretionary position would that still prevent the strategy from firing?


      Also In the strategy window I am setting the selection to "wait until flat"

      When I read the help files I took this to mean if there was an open position in that instrument the current strategy would close that first and then enter a the new position within X amount of seconds, is this correct?

      Comment


        #4
        Hello sdauteuil,

        Thanks for your reply.

        In general, you would not want to manually trade on the same instrument and same account as the strategy. The reason for this is the strategy is only aware of orders that it places and does not know of any external (to it) orders. If you enter or exit an order manually the strategy will be out of sync with its account position, however, the strategy will continue placing orders as it has been coded to.

        Please see the help guide here: https://ninjatrader.com/support/help..._account_p.htm

        The wait until flat only relates to the strategy position only, not the account position. When a strategy is applied to a chart, the strategy will place historical orders according to its logic, when the strategy has done this and is connected to real-time data, if the last historical order has not yet closed, the strategy will wait until it has closed that historical position before placing live trades on the real-time data. If you observe the strategy tab this would be shown by the background of the strategy name being yellow, when the last historical order is closed the strategy name background would show as green and would then be ready to place live trades.

        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Thank you that was quite helpful

          I have been trading for a long time but this is my first foray into automated trading. I am also testing in sim but it is helpful to have clarification to speed the learning process considering the complexity.



          from the help files you listed it is my understanding

          With "entries per direction" set to 1 and entry handling set to "all entries" only allows 1 entry per strategy to fire

          With "entries per direction" set to 1 and entry handling set to "unique entries" each of the entry parameters set in the strategy can fire 1x each


          I also have 2 ninja brokerage accounts 1 for long entries and 1 for short entries to keep that aspect separate

          Comment


            #6
            Hello sdauteuil,

            Thanks for your reply and clarifications.

            Your understanding is correct (1 each of named entries when using Unique entries with entries per direction set to 1).


            Paul H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by CortexZenUSA, Today, 12:53 AM
            0 responses
            1 view
            0 likes
            Last Post CortexZenUSA  
            Started by CortexZenUSA, Today, 12:46 AM
            0 responses
            0 views
            0 likes
            Last Post CortexZenUSA  
            Started by usazencortex, Today, 12:43 AM
            0 responses
            2 views
            0 likes
            Last Post usazencortex  
            Started by sidlercom80, 10-28-2023, 08:49 AM
            168 responses
            2,262 views
            0 likes
            Last Post sidlercom80  
            Started by Barry Milan, Yesterday, 10:35 PM
            3 responses
            10 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Working...
            X