Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

how to define this cross-up condition

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

    how to define this cross-up condition

    hi all

    i am trying at the moment to build a strategy with the strategy builder.

    one of the conditions for a long entry(short would be just the opposite) is:

    -LaguerreRSI cross up 30

    -LaguerreRSI had value of 0 for two (or more) consecutive bars before the cross


    my problem is i can't define the second condition. any help or advice would be very appreciated.


    i have attached a screenshot to show the condition


    edit: the first entry on the screenshot is a long entry and the second and third are both short entries.
    Attached Files
    Last edited by fx-art; 12-23-2011, 08:34 PM.

    #2
    Originally posted by fx-art View Post
    hi all

    i am trying at the moment to build a strategy with the strategy builder.

    one of the conditions for a long entry(short would be just the opposite) is:

    -LaguerreRSI cross up 30

    -LaguerreRSI had value of 0 for two (or more) consecutive bars before the cross


    my problem is i can't define the second condition. any help or advice would be very appreciated.


    i have attached a screenshot to show the condition


    edit: the first entry on the screenshot is a long entry and the second and third are both short entries.
    You did not state the inputs for your LaguerreRSI, so I have substituted the word params as the set of all your parameters.

    Code:
                if (LaguerreRSI(params)[2] == 0
                    && LaguerreRSI(params)[1] == 0
                    && CrossAbove(LaguerreRSI(params), 30, 1))

    Comment


      #3
      thx for your reply.

      the gamma of the laguerre would be 0,8.

      but as far as i understand your code, this would not fit my condition, because it says that the last exact two bars before the cross should be 0, but that is almost never the case, because almost always there are a few other bars with laguerre value between 0 and 30 before the cross.

      the code should be something like this:

      -laguerre value of 0 for two consecutive bars in (any of) the last bars before the cross.

      i have attached another screenshot to show what i mean.

      i hope that i could show you what i mean.

      thx for help
      Attached Files
      Last edited by fx-art; 12-24-2011, 05:56 PM.

      Comment


        #4
        Originally posted by fx-art View Post
        thx for your reply.

        the gamma of the laguerre would be 0,8.

        but as far as i understand your code, this would not fit my condition, because it says that the last exact two bars before the cross should be 0, but that is almost never the case, because almost always there are a few other bars with laguerre value between 0 and 30 before the cross.

        the code should be something like this:

        -laguerre value of 0 for two consecutive bars in (any of) the last bars before the cross.

        i have attached another screenshot to show what i mean.

        i hope that i could show you what i mean.

        thx for help
        You cannot do that with the condition builder. You need to use CountIf() to write that code.

        Code:
        if  (CountIf(delegate {return LaguerreRSI(params)[0] == 0;}, lookbackPeriod) > 1)
        Last edited by koganam; 12-25-2011, 06:53 PM. Reason: Corrected code . Occurrence should be greater than 1, not 2.

        Comment


          #5
          all right, i will try it.

          thanks for your help.

          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