Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

confirmation

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

    confirmation

    hi
    I am having trouble with number of bars confirmation.
    I have a price cross moving average exit signal. I want to have a "2 bar " confirmation or be able to change that when setting up strategy.
    Is there an easy way to do that ?

    I am missing something

    thanks

    #2
    Hello shanemcdonald,

    Could you clarify what you mean by "2 bar" confirmation? Are you referring to BarsSinceEntry?
    JCNinjaTrader Customer Service

    Comment


      #3
      hi

      that is not what I was referring to, but that looks like it may help me with another problem I have ! Isnt that funny ?


      I want to exit a position when the closing price crosses below a 10 sma moving average, but I want a second bar to close below or above that average before sending a signal. Sort of a
      "confirmation"

      but thanks for that other link. I may be able to use that as a workaround for overfills !

      Comment


        #4
        In this case you'll likely want to create a tracking variable to do this.

        Pseudo code idea:

        When CrossBelow happens -> myTrackingVar++

        If SMA > Close[0] && myTrackingVar == 1
        myTrackingVar++


        if myTrackingVar == 2
        take trade

        reset tracking var to 0 on a cross above

        This is just an idea and there are certainly other ways to go about doing this as well.
        LanceNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        102 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        144 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        71 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        125 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        79 views
        0 likes
        Last Post PaulMohn  
        Working...
        X