Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using ATR to filter entry points

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

    Using ATR to filter entry points

    I was wondering if someone could suggest a coding solution to a filter I want to add.

    It would work like this:

    If the current price (intraday chart) is less than of the close yesturday plus ATR on the daily chart then enter long.

    Can't quite get the code right. Any help is appreciated.

    Thanks

    Mark

    #2
    Mark, you'll have to add in a secondary (daily) data series to get yesterday's daily ATR value, and then you can use that in your intraday calculations.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Austin

      I have added a daily array and refered to it in the following code, doesn't seem to be working though.


      If GetCurrentAsk() < ((Close(BarsArray[
      2])[0]) + (ATR(BarsArray[2], 8)[1]))

      Can you see where i'm going wrong, it says "method name expected" and "the name close does not exist in the current context".

      Thanks

      Mark

      Comment


        #4
        This seems to have complied ok, does it seem right?


        GetCurrentAsk() < (Closes[
        2][1] + ATR(BarsArray[2], 8)[1])
        Cheers

        Comment


          #5
          Mark, if you only added one series, this would be referenced with an index of 1 since they would be 0 based, so primarty one would be 0 and then your secondary one 1 and so on...

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          639 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          366 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          107 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          569 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          572 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X