Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Double Bottom Indicator

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

    Double Bottom Indicator

    Hi,
    I'm seriously struggling with this one. I'm trying to create a Double Bottom indicator with certain features.
    I just don't know how to write a code of it. I'm aware about this code: Swing(int strength).SwingHighBar(int barsAgo, int instance, int lookBackPeriod) b and athe help guide on the swing indicator: https://ninjatrader.com/support/help...nt8/?swing.htm
    I just can't figure out how to implement following criteria.
    Here are key features of the indicator. Since Double Bottom has 2 swings I will be using SL2 and SL1 (Swing Low2 and Swing Low1) SL1 being most recent swing.
    1. There is up to 6 bars within between SL1 and SL2 (including SL1 and SL2 Bars)
    2. If SL1 is Higher then SL2 then LL (Lower Low) of SL1 to be within 2 ticks distance from LL of SL2
    3. HH coming from SL2 should be 6 ticks or more away from the 20 EMA
    I would appreciate your help with it

    #2
    Hello Ludwik,

    Use 1 as the instance for the most recent swing, use 2 as the instance for the previous most recent swing.

    With those two bars ago numbers, you would need a loop that compares the open to the close.

    Something similar to

    bool upBarFound = false;

    for (int index = startBarsAgo; index < endBarsAgo; index++)
    {
    if (Close[index] > Open[index])
    {
    upBarFound = true;
    }
    }

    Print("upBarFound: " + upBarFound);

    You can compare the high or lows of the bars to each other.

    if (Low[Math.Max(0, Swing(5).SwingLowBar(0, 1, 10))] > Low[Math.Max(0, Swing(5).SwingLowBar(0, 2, 10))] - 2 * TickSize)

    You can compare the high of the swing low bar to be greater than the EMA(20) plus 6 ticks.

    if (Low[Math.Max(0, Swing(5).SwingLowBar(0, 2, 10))] > EMA(20)[0] + 6 * TickSize)
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you Chelsea, you are helping me a lot.

      Comment

      Latest Posts

      Collapse

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