Announcement

Collapse
No announcement yet.

Elliot Wave Help

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

  • Elliot Wave Help

    Hi,

    I am trying to write an EFS for the following I found on the net:

    1. Elliot Wave oscillator (EWO)
    Parameters: hasn't parameter.
    Calculation:
    EWO (i) = MVA((high + low) / 2, 5) - MVA((high + low) / 2, 35).

    2. Elliot Wave trend (EWTREND)
    Parameters: N - number of periods, TR - trigger.
    Calculation:
    EWTREND (i) = f (last(i), high(i), low(i), TR),
    where f is logical expression,
    high(i) = max (last(j)), low(i) = min (last(j)), j = [i - N, i],
    last(j ) = MVA((high + low) / 2, 5) - MVA((high + low) / 2, 35).

    3. Elliot Wave number (EWN)
    Parame ters: N - number of periods, TR - trigger.
    Calculation: EWN (i) = f (last(i), high(i), low(i), TR),
    where f is logical expression,
    high(i) = max (last(j)), low(i) = min (last(j)), j = [i - N, i],
    last(j) = MVA((high + low) / 2, 5) - MVA((high + low) / 2, 35).

    I can understand what number 1 is trying to do but not 2 or 3. I think the EWN is suppose to be 1 to 5 measuring where in the Elliot cycle we are. Can anyone please help?

    Walid

  • #2
    Walid
    With regards to your first request you don't necessarily need an efs for that. You can just use the Price Oscillator in Basic Studies and set that to lengths 5 and 35 and HL/2 as the Source.
    However if you do want it as an efs then you can use the builtinOSc.efs that is in the Builtin subfolder of Formulas and set it as explained above.
    Alex

    Comment


    • #3
      Thanks for the info Alex. I just can't figure out the logic of EWN and EWTREND.

      Walid

      Comment


      • #4
        Alex,
        Is there a modification of the BuiltinOsc that has an audio alert when the zero line is crossed?

        Thanks,

        Ed

        Comment


        • #5
          Ed
          Add the following lines of code in the main section of the builtinOsc.efs and it will trigger a sound alert if at the completion of a bar the oscillator has crossed 0.
          Alex

          PHP Code:
          if(getBarState()==BARSTATE_NEWBAR){
                  if(
          vOsc.getValue(OscStudy.OSC,-2)<0&&vOsc.getValue(OscStudy.OSC,-1)>0||
                     
          vOsc.getValue(OscStudy.OSC,-2)>0&&vOsc.getValue(OscStudy.OSC,-1)<0)
                         
          Alert.playSound("ding.wav");
              } 

          Comment


          • #6
            Thanks Alex

            Comment


            • #7
              modification

              Hi Alex,

              If you're after an audible alert if the bar completes above or below a certain value EG: above or below 0.03 then would you modify thus..???

              if(getBarState()==BARSTATE_NEWBAR){
              if(vOsc.getValue(OscStudy.OSC,-2)<0&&vOsc.getValue(OscStudy.OSC,-1)>0.03||
              vOsc.getValue(OscStudy.OSC,-2)>0&&vOsc.getValue(OscStudy.OSC,-1)<0.03)
              Alert.playSound("ding.wav");
              }

              also how do you get that alert pop up box to do pop up also?

              Many Thanks

              Comment


              • #8
                soap3000
                Enclosed below is how you would need to write the condition to trigger both an audible and popup alert if either 0.03 or -0.03 values are crossed on a completed bar
                Alex

                PS. In the second condition I am assuming you want an alert if the oscillator crosses -0.03
                Replace -0.03 with 0.03 if the latter is instead the threshold

                PHP Code:
                if(getBarState()==BARSTATE_NEWBAR){
                    if(
                vOsc.getValue(OscStudy.OSC,-2) < 0.03 && vOsc.getValue(OscStudy.OSC,-1) > 0.03 ||
                       
                vOsc.getValue(OscStudy.OSC,-2) > -0.03 && vOsc.getValue(OscStudy.OSC,-1) < -0.03){
                            
                Alert.playSound("ding.wav");
                            
                Alert.addToList(getSymbol()+","+getInterval(),"Crossing threshold",Color.black,Color.red);
                    }

                Comment


                • #9
                  Thanks - as ever, for your prompt and efficient response.

                  Please excuse my programing ignorance.... if I wanted to run the same sort of alert for another indicator - where do I find the code names for that indicator. Price Oscillator looks to be 'vOsc' what are the others?

                  In particular I am looking for the 'library name' for the ADX line.

                  Also...

                  Is it possible to have an alert trigger if two conditions are met ie:

                  Price Oscillator is +/- 0.03 whilst simultaneously ADX line is above 25 on completion of that bar...?

                  Thanks for taking the time.

                  Comment


                  • #10
                    soap3000
                    You are most welcome

                    if I wanted to run the same sort of alert for another indicator - where do I find the code names for that indicator. Price Oscillator looks to be 'vOsc' what are the others?
                    If you are using an existing formula then you will need to reference the names of the variables used in that script.
                    If instead you are asking for the names of the available functions then you can find these listed in the EFS KnowledgeBase under Function Reference-> Built-In Study Functions

                    In particular I am looking for the 'library name' for the ADX line
                    You can find the description and syntax for the ADX function(s) in this article in the EFS KnowledgeBase

                    Is it possible to have an alert trigger if two conditions are met ie:
                    Price Oscillator is 0.03 whilst simultaneously ADX line is above 25 on completion of that bar...?
                    You can include as many conditions as you wish to trigger an alert (or any other event). See the sample code enlosed below which will trigger an audible and popup alert when the Oscillator crosses above 0.03 and the ADX is above 25.
                    Note that the syntax is slightly different from the one used in the script posted earlier in this thread because in this case I am using the EFS2 functions instead of the EFS1 functions (which are still available by the way)
                    Alex

                    PHP Code:
                    var xOsc null;//declare the external variable
                    var xADX null;//declare the external variable
                     
                    function main(){
                     
                        if(
                    xOsc==nullxOsc osc(5,35,false);//initialize the Oscillator study
                        
                    if(xADX==nullxADX adx(14,14);//initialize the ADX study
                        
                        
                    if(xOsc.getValue(-2)==null||xADX.getValue(-2)==null) return;//null check on oldest value used
                                                                                    //in the conditions
                        
                        
                    if(getBarState()==BARSTATE_NEWBAR){
                            if(
                    xOsc.getValue(-2)<0.03 && xOsc.getValue(-1)>0.03 && xADX.getValue(-1)>25){
                                
                    Alert.playSound("ding.wav");
                                
                    Alert.addToList(getSymbol()+" "+getInterval(),"Crossing above",Color.black,Color.lime);
                            }
                        }
                        
                        return 
                    xOsc.getValue(0);

                    Comment

                    Working...
                    X