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:	95
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:	78
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 NullPointStrategies, Today, 05:17 AM
            0 responses
            50 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            126 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            68 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            42 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            46 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X