Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy with regression channels

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

    Strategy with regression channels

    Hello
    I would like to create a strategy by which I would get an alert when 2 regression channels are pointing in the same direction of the trend. That is if one of the channel is parallel or pointing in the opposite direction I would not get the alert.

    I don't know which kind of value would be to create the alert when the regression channel is tipping in the direction of the trend.

    If anyone could help me with this it'd be great. I attach an image showing when to create the alert in a trend down.

    Thanks very much in advance.
    Attached Files

    #2
    Hello,

    If you are wanting to compare if two channels are pointing the same direction or more accurately are both Falling or Rising, one way would be to check if the DataSeries is Rising or Falling.

    Checking each of the RegressionChannels like the folloiwng:

    Code:
    if(Rising(RegressionChannel(Close, 12, 4).Upper))
    {				
    }
    This statement would check that the Upper is Rising, you could also check the Lower or other channels in the same way to create a condition.

    I look forward to being of further assistance.

    Comment


      #3
      Hello Jesse
      Thanks very much for your reply. I have a couple of doubts.
      1. Where do I edit DataSeries?
      2. What do the figures 12 and 4 stand for?
      Regards
      Alberto

      Comment


        #4
        Hello,

        For finding out about what each method does, I would recommend reviewing the help guide. For Rising and Falling, you can find them here:



        The RegressionChannel is here:


        From the example, it would be using the following overload set:
        Code:
        RegressionChannel(IDataSeries input, int period, int width)
        The values would be the period and width, the Input was the Close DataSeries. For using a different series, you would change Close if you are trying to use a different series in the RegressionChannel.

        If you instead wanted the High series it would look like the following:
        Code:
        if(Rising(RegressionChannel(High, 12, 4).Upper))
        {				
        }

        The values I had used were just random values to show how the syntax is used.

        I look forward to being of further assistance.

        Comment


          #5
          Ok Jesse
          So in order to do this I would have to edit the code, right? I wouldn't be able to set these parameters at the menus offered by the strategy when using the "When the following conditions are true", would I?
          Thanks very much

          Comment


            #6
            Regression Channels Rising alignment

            Ok Jesse
            Yes I see that is thrugh the conditions options. So I see that that the rising falling options are available at the miscellaneous section but as a separte window from the indicator selected, since once you selecting parametes for the indicator the miscellaneous only offfers DATASERIES as an option.

            So then it would be to add 2 options at the When field? 1 for the indicator and another for the miscellaneous rising or falling?

            Thanks a lot
            Alberto

            Comment


              #7
              Hi Alberto

              Very quickly:

              Firstly, this can all be done with the Wizard. For something that's rising, on the left, go to 'Misc' and select 'Rising'. On the right, go to 'Misc' and select 'True'. Underneath, select the indicator in the 'Default' box: '...'

              The code would actually look something like this:

              Code:
              if(
              Rising(RegressionChannel(8, 2).Middle) == true
              && Rising(RegressionChannel(16, 2).Middle) == true
              )
              
              EnterLong(1, "");
              The first overload or parameter is the Period or length and the second one is the width of the line.
              Last edited by arbuthnot; 08-16-2015, 08:12 AM.

              Comment


                #8
                Hello Arbuthnot
                This is what I am doing:
                ADD CONDITION 1: LEFT COLUMN: Misc: Rising == RIGHT COLUM: Misc: True
                ADD CONDITION 2: LEFT COLUMN: Indicators: Regression Channel: Period: 90 == RIGHT COLUMN: Misc: Rising

                But when I try to accept I get this message: Return type of left expression "Regression Channel" and right expression 'Boolean' do not match. You need to select a different item... So it won't allow me to add Rising to the 2nd condition. How can I avoid the Boolean?

                Thanks very much for the reply
                Alberto

                Comment


                  #9
                  Hello Alberto,

                  When I created the wizard as member arbuthnot suggested I can compile without error. To clarify the instructions I have added a couple of screenshots to show the selections made.
                  Attached Files

                  Comment


                    #10
                    Thanks ,Paul, for the brilliant graphics.

                    I was thinking of doing the same sort of thing to describe the situation to Alberto but I wouldn't have done as good a job!

                    Comment


                      #11
                      Hello Paul
                      Thanks very much for the images that were very clear. Now I see the channels plotted in the chart and it's taking orders. But a couple of things:
                      1. I want to place the orders when the 2 regression channels are rising. Now it is taking orders when one of them is not rising. Or even when both are falling. I attach image of the chart with both channel falling and it took orders and another image of the parameters.
                      2. How can I see the orders placement? Now I hear the voice of "Order filled" but I don't see its placement on the chart like I would with ChartTrader.

                      Thank you very much for the help
                      Alberto
                      Attached Files

                      Comment


                        #12
                        Thanks so much

                        Thanks so much

                        Originally posted by arbuthnot View Post
                        Thanks ,Paul, for the brilliant graphics.

                        I was thinking of doing the same sort of thing to describe the situation to Alberto but I wouldn't have done as good a job!

                        Comment


                          #13
                          Originally posted by Alberto Moreno View Post
                          Hello Paul
                          Thanks very much for the images that were very clear. Now I see the channels plotted in the chart and it's taking orders. But a couple of things:
                          1. I want to place the orders when the 2 regression channels are rising. Now it is taking orders when one of them is not rising. Or even when both are falling. I attach image of the chart with both channel falling and it took orders and another image of the parameters.
                          2. How can I see the orders placement? Now I hear the voice of "Order filled" but I don't see its placement on the chart like I would with ChartTrader.

                          Thank you very much for the help
                          Alberto
                          Hello Alberto,

                          The issue is one of perception and expectations. Both regression channels are meeting the conditions requested even though it does not appear that way. The perception issue is that we are looking back from a further distance whilst the computer is coldly looking at calculations.The Rising condition becomes true when the current data point is higher than the previous data point. (I printed out the values of the middle line to validate). So a very small change, uptick if you will, results in both trend channel middle lines ticking up in values thus meeting the "Rising" condition.

                          It is likely that you may want to use another method of determining that the regression lines are rising or falling so that you are not looking at the latest small change. It is possible that, with some study, using slope may be the answer.

                          Regarding the strategy execution plots you should see those on the chart you applied the strategy to. Please make sure you have turned on "Plot Executions" in the data series of the chart

                          Comment


                            #14
                            Hello Jesse
                            Yes, that is ambiguous really... What I want to do is trigger the entry when the a candle which is inside these channels, is greater that 6 ticks and whose wick is a least 50% of the total ticks of the candle and pointing in the direction of the 2 channels and the price reaches 1 tick below this candle. Then I would trigger buy or sell depending on the falling or rising of the channels.

                            How could I create this condition for this candle?

                            Thanks very much for the help
                            Alberto

                            Comment


                              #15
                              Hello Alberto,

                              You've listed 5 criteria for entry.

                              1) Candle inside regression channel means that you would compare the current bars High and low points to the upper and lower trendlines, IE: Is High[0] < RegressionChannel(20,4).Upper[0] is the Low[0] > RegressionChannel(20,4).Lower[0]

                              2) Candle > 6 ticks: (High[0] - Low[0]) /TickSize >= 6

                              3) Wick is 50%, I'm not sure which side of the candle you are considering but basically it would be the difference between the High[0] and either the Open[0] or the Close[0] as compared to the overall High[0] - Low[0]

                              4) Pointing in direction of the 2 channels, not sure what you mean here. Is it simple needs to be an up candle or down candle?

                              5) Price goes 1 tick below the preceding candle that met the prior 4 criteria?

                              Hopefully this is enough to get you started.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              656 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              371 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              109 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              574 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              579 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X