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.
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by JTizz, Today, 01:20 PM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by omermirza, Today, 12:39 PM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_Jim  
    Started by mballagan, Today, 01:02 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Kate  
    Started by larkmail, Today, 12:30 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Kate  
    Started by Danila, Today, 11:08 AM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X