Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Can't Dial in Cross Above/Below Entry Condition

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

    Can't Dial in Cross Above/Below Entry Condition

    Hello Good People,

    I'm having issues using CrossAbove within my entry conditions for a short entry. What I want to see is price:
    1. CrossAbove myLevel - we'll call this Candle A
    2. And then, close below myLevel (can be candle A or next candle(s))
    3. Current Delta[0] < Delta [1]
    Works great sometimes, but other times the Close[1] condition counts the previous candle before the CrossAbove condition and enters me early. I've tried to insert a bool which turns true once the CrossAbove condition is made, but I'm still having the same issue.

    What is the best way to insure the CrossAbove condition happens first and then the Close[1] < myLevel happens next (never counting a candle as closed before CrossAbove is made)?

    I've tried different Look Back periods, but same issue. I'm sure it's simple but I'm not seeing it....

    Code:
    if  (CrossAbove(Close, myLevel, 5))
                                            
    {
         enableTrade = true; 
    }
                                        
     if   ((enableTrade == true) && (Close[1] < myLevel)
            && (cumulativeDelta.DeltaLow[0] < cumulativeDelta.DeltaLow[1]))
    {
    EnterShort()
    }
    ​
    Many thanks in advance for any guidance!

    #2
    Hello swjake,

    Thank you for your post.

    Based on your description, my understanding is that you would like the CrossAbove to happen on one candle, then you want to check the next condition on the following bar after the bar for the crossover occurred. To do this, you could save the bar index where the crossover condition becomes true, then check in your next condition if the current bar is greater than that saved bar number:
    Code:
    if (CrossAbove(Close, myLevel, 5))
    
    {
    enableTrade = true;
    savedCrossoverBar = CurrentBar;
    }
    
    if ((enableTrade == true) && (Close[1] < myLevel)
    && (cumulativeDelta.DeltaLow[0] < cumulativeDelta.DeltaLow[1]) && CurrentBar > savedCrossoverBar)
    {
    EnterShort()
    }​
    Please let us know if we may be of further assistance.

    Comment


      #3
      Thank you Emily!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      47 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      23 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      33 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      51 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Working...
      X