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 Skifree, Today, 03:41 AM
        1 response
        1 view
        0 likes
        Last Post Skifree
        by Skifree
         
        Started by usazencort, Today, 01:16 AM
        0 responses
        1 view
        0 likes
        Last Post usazencort  
        Started by kaywai, 09-01-2023, 08:44 PM
        5 responses
        603 views
        0 likes
        Last Post NinjaTrader_Jason  
        Started by xiinteractive, 04-09-2024, 08:08 AM
        6 responses
        23 views
        0 likes
        Last Post xiinteractive  
        Started by Pattontje, Yesterday, 02:10 PM
        2 responses
        22 views
        0 likes
        Last Post Pattontje  
        Working...
        X