Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Prevent indefinite orders when price changes up and down?

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

    Prevent indefinite orders when price changes up and down?

    I have a simple crossover strategy that works fine historically but on replay mode, it takes indefinite orders over and over when the crossover is happening as price moves up and down.
    I have it on price change. I don't want to use on close as price can move big for stop loss.
    Is there a way to tell it only take crossover after certain time or some other solution?
    As you see below, it works fine when the crossover moves quick but if it's flat, it takes orders over and over.
    thanks for any idea
    Click image for larger version

Name:	image.png
Views:	105
Size:	39.2 KB
ID:	1341894

    #2
    Hello Mystery,

    Are you using the strategy builder or manually coding?

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      Hello Mystery,

      Are you using the strategy builder or manually coding?
      Strategy builder but I can convert it to script if needed to use any logic to prevent it.

      Comment


        #4
        Hello Mystery,

        In the builder you can use Bars since entry execution to avoid same bar entries.

        In the set with your entry condition click the "group" button in the conditions area
        Leave the default of "if any" selected

        Add a condition
        Use the following
        Left: Misc -> bars since entry -> leave the defaults of 0 and 0, then enter the signal name you used for the entry
        Center: equals
        Right: Misc -> Numeric value -> Enter -1

        Add another condition
        Use the following
        Left: Misc -> bars since entry -> leave the defaults of 0 and 0, then enter the signal name you used for the entry
        Center: Greater equals
        Right: Misc -> Numeric value -> Enter 1 or the number of bars you want to wait before another entry can happen

        Comment


          #5
          Originally posted by NinjaTrader_Jesse View Post
          Hello Mystery,

          In the builder you can use Bars since entry execution to avoid same bar entries.

          In the set with your entry condition click the "group" button in the conditions area
          Leave the default of "if any" selected

          Add a condition
          Use the following
          Left: Misc -> bars since entry -> leave the defaults of 0 and 0, then enter the signal name you used for the entry
          Center: equals
          Right: Misc -> Numeric value -> Enter -1

          Add another condition
          Use the following
          Left: Misc -> bars since entry -> leave the defaults of 0 and 0, then enter the signal name you used for the entry
          Center: Greater equals
          Right: Misc -> Numeric value -> Enter 1 or the number of bars you want to wait before another entry can happen
          Thank you for suggestion but it didn't work.
          Maybe something still needs to add here.

          Click image for larger version

Name:	image.png
Views:	86
Size:	69.8 KB
ID:	1341910

          Comment


            #6
            I think it worked. I created a new strategy and it seems to stop indefinite order.
            I'll test more. thank you

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            43 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            20 views
            0 likes
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            30 views
            1 like
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            48 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            38 views
            0 likes
            Last Post CarlTrading  
            Working...
            X