Announcement

Collapse
No announcement yet.

Handling non-concurrant Buy/Sell Signals

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

  • Handling non-concurrant Buy/Sell Signals

    I am working on an efs with multiple buy signals and multiple sell signals. I am having some pretty serious "brain lock" and I was hoping someone could provide me with some ideas.

    For instance, I have some specific buy signals that come in that involve a number going from above 0.95 to below 0.95. A second involves something similar, where an indicator goes from below 20 to above 20. A third one being a positive slope of a different indicator.

    These 3 indicators may not all be in concurrantly in one bar, they may individually come in in a space of 3 or 4 bars. If they come in within this period, I would initiate a buy. Similar conditions apply to placing a short.

    Does anyone have any ideas as to how to handle these non concurrant, "concurrant" signals.

    Any help would be appreciated.

  • #2
    Using Flags should take care of this. I am working on something very similar. The FLAGS are what I had to resort too.

    Fibbgann
    Excellent book on JavaScript for beginners

    Comment


    • #3
      Well, I guess in the process of formulating the question, I believe I have come up with an answer, an epiphany, so to speak

      PHP Code:
      var bStart 5                
          
      if (Buy condition 1 is met//generalized statement only
          
      bC1 bStart;
      if (
      bC1)//if zero this is false
          
      bC1--;

      if (
      Buy condition 2 is met
          
      bC2 bStart;
      if (
      bC2)
          
      bC2--;

      if (
      Buy condition 3 is met
          
      bC3 bStart;
      if (
      bC3)
          
      bC3--;
          
      if ((
      bC1)&&(bC2)&&(bC3))
          
      go buy 
      Well, I think this will work, if anyone has any suggestions, please let me know.

      TIA

      Comment


      • #4
        Do your first set of conditions thenV flag it 0, so 2nd set of conditions then Vflag it 1 and is true if Vflag 0 is true, and so on.

        Fibbgann
        Excellent book on JavaScript for beginners

        Comment


        • #5
          It should like this in respect to your criteria
          Attached Files
          Excellent book on JavaScript for beginners

          Comment


          • #6
            Steve,

            I had a similar problem. Here are my two cents.

            For each long condition set up an array of boolean (true/false). Make the length of the array the number of bars in which you want to bracket your conditions. On each new bar update the array with the current condition. At the end of the new bar block check to see if all of the arrays contain true. If so, then you have an enter long condition.

            a_1 T F F F F
            a_2 F F F T F
            a_3 F T F F F

            Do the same thing for short. If you are comfortable with multi-dimensional arrays you could do this with one three-dimensional array. You can use a push inside a for loop in you initialization section to control the length of the arrays with a function parameter.

            Might not be the best way, but should get the job done. Maybe someone else has a more efficient solution.

            You may also want to check out the Signal Clarity thread. They are working on a multiple condition trigger. However, I don't believe they are bracketing the conditions within a certain number of bars.
            http://forum.esignalcentral.com/showthread.php?s=&threadid=5975&highlight=FGAll

            Comment

            Working...
            X