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 charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        61 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