Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CROSSOVER questions

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

    CROSSOVER questions

    hello,

    I am not getting consistent behavior with the cross method. Explanation follows.

    I need to generate a signal when price crosses the upper regression channel. my code looks like this:

    Code:
    double shortLine = RegressionChannel(50, 3.5).Upper[0];
                
    if (CrossAbove(High, shortLine, 1)) 
    {
        ShortSignal.Set(shortLine);    
    }
    This code works quite well most of the time. It appears that there are situations where it doesn't. Around the news is one situation. A fast moving market seems to be the case in which the line that sets the "ShortSignal" plot doesn't get called.

    Are there cases you can think of that the CrossAbove will return false even though price does "cross" the channel?

    In order for the cross to return true, does price need to be greater than the channel or is it enough for it to be equal?

    On a gap, will the CrossAbove return true or does price need to run through the channel for it to return true?

    I have the CalculateOnBarClose set to false. Does it make a difference if I am using the High or the Close in order to determine a cross over?

    In the call to CrossAbove, the "1" value means that the high of the previous bar has to be lower than the channel and the high of the current bar needs to be higher than the upper channel - right?

    Since the regression channel 1 bar back is moving, could it be that this is what is messing things up for me?


    Hope all this makes sense.
    Onn

    #2
    Hi Onn, so the issue is in realtime trading / Market Replay only for the generated signals? Here you could be seeing whipsaw trades with CalculateOnBarClose = false and the Regression Channel as it would always provide a best fit estimate it would recalculate with new intrabar info received, thus triggering potentially orders intrabar that would not persist until the close of the bar.

    Comment

    Latest Posts

    Collapse

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