Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Wait 30 minutes

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

    Wait 30 minutes

    Hi,

    I am running a straight forward Strategy that I created in the Wizard. Basically if one moving average crosses a pivot line then go either Long or Short depending upon the direction.

    Is there a way to add code to the Strategy that says once you receive a new Signal then ignore all other signals for xx minutes. For example if I am running a Strategy on a 5 minute chart I want to ignore all other signals for at least the next 30 minutes?

    Thank you,

    #2
    Hello Scarlett09,
    Thanks for your post.

    Unfortunately you cannot do it using the wizard. You can however further custom code this via the NinjaScript Editor.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      OK, that is great. Is there a standard line or two of code that can be added to the existing code or is this dependent on what the strategy entails? I would be happy to to move to the NinjaScript Editor.

      Comment


        #4
        Hello Scarlett09,
        Yes, you can simply use the BarsSinceEntry function to do it.

        If you are running the code on a 5 minute chart then you can use the following code:

        Code:
        if (this.BarsSinceEntry() > 6 || this.BarsSinceEntry() == -1)
        {
         //do something.
        }
        JoydeepNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

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