Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ATR Stop

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

    ATR Stop

    I have just started trying to code a strategy. I am trying to go LONG when close crosses over the ATR stop using the SuperTrend indicator listed in the forum. When the close crosses below the ATR stop exit the
    LONG.

    It compiles.

    When I apply it to the chart, it completes the first entry at the start of the data series, Futures contract, then it does not close when close crosses below the ATR stop. It closes at the EOD.

    Any one willing to help me get started? See attached code.

    ATRSTOP.cs

    #2
    Can you post the indicator as well? Thanks ...

    You just have entry orders defined in your code; I'll be able to investigate more closely if you can post the indicator, too.

    Comment


      #3
      See attached file. SuperTrend.cs

      Comment


        #4
        rtj4201, please retry without any CalculateOnBarClose references in your indicator / strategy codes.

        Comment


          #5
          How do you do that? remove calculate on bar close?

          Comment


            #6
            You would need to remove those lines from the Initialize() methods of your indicator and strategy, then recompile the studies, reapply them fresh and recheck.

            Comment


              #7
              why is that keeping it from working correctly?

              Comment


                #8
                rtj4201, there is currently a known issue referencing indicators that have a hardcoded CalculateOnBarClose setting.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by charlesugo_1, 05-26-2026, 05:03 PM
                0 responses
                67 views
                0 likes
                Last Post charlesugo_1  
                Started by DannyP96, 05-18-2026, 02:38 PM
                1 response
                150 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