Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Adding a Swing Strength filter to the 'Sample Advanced Automated Strategy'

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

    Adding a Swing Strength filter to the 'Sample Advanced Automated Strategy'

    Greetings!

    I appreciate the 'Sample Advanced Automated Strategy' included on the downloads. I am trying to add 1 filter, based on the SwingGap indicator:

    && ((SwingGap(5).SwingHigh[0]) - (SwingGap(5).SwingLow[0])) > 14

    When added to the long entry condition, it compiles with no problems, but the strategy no longer takes any longs in backtests. This is regardless if the gap between swing areas is < 14 or > 14 ! Once the line is commented out the long trades appear again.

    I am just starting out modifying strategies and this has frustrated me for a whole day. Can someone please show me my error?

    Exported strategy script is attached.

    Thanks!
    Jon

    so far I have made a private init so I can modify the value I need to measure, and a double to validate the math, but the compiler gives
    me errors I cant figure out (expecting statements in the starategy)
    Uploading the changes I made in a .cs .
    Attached Files
    Last edited by Trader.Jon; 05-23-2010, 03:11 PM. Reason: my progress gives more to learn

    #2
    .CS for my last message

    I wasnt able to manage the upload on my last message ... this is the .cs that wont compile .. programmer input appreciated

    Jon
    Attached Files

    Comment


      #3
      Hello,

      I am sorry we don't debug custom indicators. If you have a specific question on code we can help though.

      I suggest using Print() to print both your swing gap values in the condition to see if they are returning the values you expect:
      DenNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

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