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 kinfxhk, 07-14-2026, 09:39 AM
        0 responses
        125 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-13-2026, 10:18 AM
        0 responses
        105 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-13-2026, 09:50 AM
        0 responses
        85 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-13-2026, 07:21 AM
        0 responses
        105 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-11-2026, 02:11 AM
        0 responses
        85 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X