Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to enter trade when >3/12 of conditions are met?

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

    How to enter trade when >3/12 of conditions are met?

    I have a pool of 12 entry conditions and want to enter a trade if greater than 3/12 of the conditions are met.

    I tried do in strategy builder but, the entry occurs when a single condition is even met.

    If anyone needs more information i am happy to provide more.

    Thanks

    #2
    Do you mean if any random 3 conditions out of the total 12 are met ? or you mean: if some specific 3 conditions of the total 12 ones ?

    Comment


      #3
      Hello ishcan,

      Add an integer.

      Set the integer to 0 at the top of OnBarUpdate().

      In each condition set action block increment the integer by one.

      For the last condition if the int is greater than 2, trigger the action.

      Below are links to forum posts on using an integer (or custom int series in the Strategy Builder) as a counter.
      https://ninjatrader.com/support/foru...260#post812260
      https://ninjatrader.com/support/foru...on#post1078538

      Also, below is a link to a forum post with helpful resources on getting started with C# and NinjaScript.
      Last edited by NinjaTrader_ChelseaB; 01-10-2023, 08:38 AM.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Thank you Chelsea B.​ but the original question was not mine.

        Comment


          #5
          I have had a look at this counter concept, but when counting, it counts the same condition more than once.

          So for example:

          If X is 1/12 conditions, and it is met, i do not want it to count that condition again when looking for the second condition to meet or third or forth... and so on.

          I dont know if i could explain my self.

          But >3/12 different unique conditions, each condition is unique and same condition is not counted for more than once.

          Thanks

          Comment


            #6
            Hello ishcan,

            Each condition set is only evaluated once each time OnBarUpdate() runs. The integer is set to 0 at the start of OnBarUpdate(). Each condition set would only be counted once.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, Yesterday, 05:17 AM
            0 responses
            65 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            139 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            75 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            45 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            50 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X