Announcement

Collapse
No announcement yet.

Setting the Stochastic Price Source...

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

  • Setting the Stochastic Price Source...

    Anyone know how i can set a Stochastic to work off of a price source of OHLC/4?

    Thanks.
    none

  • #2
    rwd1971
    Click here and download StochasticOf_Montage.efs
    Alex

    Comment


    • #3
      Thanks... I noticed that there is only a Simple and Exponential setting for the MA and no Smooth? Do you have any ideas where I can find some info on immplenting this into the EFS?

      TIA


      if(MAType=="Exponential"){
      if(aValue[LengthD-1] != null)
      vEMA = EMA(LengthD, aValue);

      return new Array (sum,vEMA);
      }
      else if(MAType=="Smooth"){
      //code to be added here

      return new Array (sum,vSMA);
      }
      else{
      return new Array (sum,vSMA);
      }
      none

      Comment


      • #4
        rwd1971
        What script are you referring to?
        I don't see that portion of the code in the efs I suggested
        Alex

        Comment


        • #5
          The 1 u suggested is the 1 i am using... look down near the end of the main() function...

          Thanks for your time...
          none

          Comment


          • #6
            rwd1971
            What line numbers?
            Alex

            Comment


            • #7
              Should be line 603 for the start...

              Thanks
              none

              Comment


              • #8
                rwd1971
                This is what I see in lines 600-610

                PHP Code:
                 var vSMA nSum/LengthD;
                    
                    
                    if(
                MAType=="Exponential"){
                        if(
                aValue[LengthD-1] != nullvEMA EMA(LengthDaValue);  
                        return new Array (
                sum,vEMA);
                    }else{
                        return new Array (
                sum,vSMA);
                    }
                    

                There is no section

                else if(MAType=="Smooth"){
                //code to be added here

                return new Array (sum,vSMA);
                }


                that I can see.
                Alex

                Comment


                • #9
                  Yes that's what is there.... what I am trying to do is add some code to that section so that it can calculate a Smooth option. I noticed that MAType does not have this as an option though so I would have to code something up myself and don't have a clue on where to start.... hoping maybe you do!

                  ie.


                  if(MAType=="Exponential"){
                  if(aValue[LengthD-1] != null) vEMA = EMA(LengthD, aValue);
                  return new Array (sum,vEMA);
                  }else if(MAType=="Smooth"){
                  //add code here to calculate smoothing...
                  return new Array (sum,vSMA);
                  }else{
                  return new Array (sum,vSMA);
                  }

                  none

                  Comment


                  • #10
                    rwd1971
                    "Smooth" is not a specific type of moving average like "Simple" or "Exponential", etc. All it means is that the plot is being smoothed by applying an average to it. In the Stochastic that is usually done to %K which is already happening in the efs I suggested. The "Simple" or "Exponential" option instead is used to create %D
                    If you want a Stochastic with %D smoothed then see this thread where Jason has already posted several variations (StochWithDslow.efs for example).
                    Alex

                    Comment


                    • #11
                      rwd1971
                      In addition to the studies at the link I provided in my prior reply you may also want to see this thread which shows you how to create a Stochastic with smoothed %D using only the Formula Wizard.
                      Alex

                      Comment


                      • #12
                        Thanks I'll check that out...

                        BTW would there be an EFS file you could give as an example to follow?

                        none

                        Comment


                        • #13
                          rwd1971
                          In the thread I indicated in my last message you will find an efs that was done with the Formula Wizard. open it using that tool to see how it was created.
                          Also see this thread for a brief guide on how to create studies on studies using the Formula Wizard
                          Alex

                          Comment

                          Working...
                          X