Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

look back crossover

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

    look back crossover

    Think I'm missing the genius of this ,, from my test the lookback doesn't do much since if the lookback is set to 1 or 1000,, the first bar crossing the EMA fires this..
    what am i missing?
    This looks more like " or "of the lookback bars instead of "and" of the lookback bars

    if (CrossAbove(EMA(10), EMA(20), 1))
    EnterLong();
    Last edited by gg80108; 06-21-2010, 05:21 PM.

    #2
    gg80108, with the lookback parameter you specifiy over which range of bars the cross can be detected - a lookback of 10 for example means the cross had to happen within the last 10 bars.

    What condition are you trying to create?

    Comment


      #3
      I want to filter out whip saws, where a cross occurs and the next bar crossed back, I dont want to take any action until the the next bar after the cross..

      Comment


        #4
        Hello gg80108,

        You'd have to code for the sequence you're after. You can do this with user variables or bool flags. The reference sample below offers a sample implementation on user variables to look for a specific sequence.



        PseudoCode below with bool flags:

        if (CrossAbove)
        FirstCross = true;

        if (FirstCross && !CrossBelow)
        placeYourTrades;
        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        574 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        332 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
        553 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X