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 charlesugo_1, 05-26-2026, 05:03 PM
            0 responses
            64 views
            0 likes
            Last Post charlesugo_1  
            Started by DannyP96, 05-18-2026, 02:38 PM
            1 response
            149 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 05-11-2026, 05:56 AM
            0 responses
            162 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 05-10-2026, 08:12 PM
            0 responses
            99 views
            0 likes
            Last Post CarlTrading  
            Started by Hwop38, 05-04-2026, 07:02 PM
            0 responses
            286 views
            0 likes
            Last Post Hwop38
            by Hwop38
             
            Working...
            X