Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Avoiding Multiple Consecutive Signals

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

    Avoiding Multiple Consecutive Signals

    Hello

    I'm running a strategy with 4 different signal types. What I want to achieve is the following:
    Whenever a signal is generated, I want to make sure that there can't be another one (regadless of its type) on the next bar. Are Bool Flags the only way to go here? I'm asking this because I'm already using bool flags for another feature and I'm afraid that using them twice will make the code too complicated.

    Thanks

    #2
    Originally posted by laocoon View Post
    Hello

    I'm running a strategy with 4 different signal types. What I want to achieve is the following:
    Whenever a signal is generated, I want to make sure that there can't be another one (regadless of its type) on the next bar. Are Bool Flags the only way to go here? I'm asking this because I'm already using bool flags for another feature and I'm afraid that using them twice will make the code too complicated.

    Thanks
    Hi,
    First, I would advise not to combine several signals into one strategy.
    The answer to your question is NO. You can use integer, like if you enter a trade you put x=12345678 and on the next bar ask: if x=12345678 then x=0 and exit.
    Or string, like in x='please don't take a trade' and you know what to do on the next bar.
    You can use all other types.

    Comment


      #3
      Hi Laocoon,

      Thank you for posting.

      The bool is the only way I can see how you would only to not have any other signals being called on the next bar.

      If you do not want to use a bool, you can use an Int variable to be able to create the same effect with the bool.

      Let me know if I can be of further assistance.
      Cal H.NinjaTrader Customer Service

      Comment


        #4
        Thanks Baruch and Cal for your replies. I'll try to use the int variable then.
        Are there any examples (other than the Ninja Online Help) where the int variable is used in a similar way to what I'm trying to do?

        Thanks

        Comment


          #5
          laocoon,

          I'll throw my 2 cents in: I had a strategy that had something like 27 bool flags coded in. I ran the strategy on COBC=false and ran it on very fast range bars (like 3 and 4 tick wide bars). I did this on roughly 10 different instruments simultaneously. This worked fine and nothing every hiccuped. No reason you can't use several bool flags.

          Comment


            #6
            Thanks for your post, coolmoss. This is very interesting indeed.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            633 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            364 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            105 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            567 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            568 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X