Announcement

Collapse
No announcement yet.

Stoch values differ when "source" is specified

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

  • Stoch values differ when "source" is specified

    Hi,

    As I understand it, as long as you use the same symbol, source, and interval the result of the following stochactics studies should all plot the same:

    Assumption: The default source for stochastics is “default: high, low and close” as stated in the “eSignal EFS Developer’s Reference”. Yet no matter which source I use the resulting stochastics value differs from the same stochastics when no source is specified.

    On a chart displaying the “ES #F” on a 3 minute interval with source for stochastics = hlc3():

    As you can see in the attached chart the values for stochastics for the above “xTypes” differ, (I can't create a table in this post so values are all together)

    Study Type (see basicStoch-test1.efs) StochK Value (see chart) StochD Value (see chart)
    5,3,3 stochastics from "Basic Menu" 30.005 23.48
    xType == "_Std" stochK(5,3,3); 30.005 23.48
    xType == "_inv" stochK(5,3,3,inv(3)); 30.005 23.48
    xType == "_C-inv" stochK(5,3,3,hlc3(inv(3))); 1.85 1.23
    xType == "_C-Sym"stochK(5,3,3,hlc3(sym("ES #F,3"))); 1.85 1.23

    I must repeat: no matter which source I use the resulting stochastics value differs from the same stochastics when no source is specified (open(), high(), low(), close(), hl2(), hlc3(), or ohlc4()).

    I can only guess that it is a bug.

    The page, chart, and test efs are attached in a zip file.

    Thanks
    Attached Files
    Last edited by waynecd; 05-23-2008, 04:00 PM.

  • #2
    waynecd

    Assumption: The default source for stochastics is “default: high, low and close” as stated in the “eSignal EFS Developer’s Reference”.
    What that means is that the Stochastic Oscillator is calculated using ALL those three price sources ie the highest High, the lowest Low and the current Close. To understand how the Stochastic Oscillator is calculated you may want to see the following formulas which are all in the Library folder of Formulas ie StochasticHH, StochasticLL, StochasticK and StochasticD

    Yet no matter which source I use the resulting stochastics value differs from the same stochastics when no source is specified.
    That is to be expected. When you pass a source to the Stochastic function it will calculate the indicator using the highest, lowest and current values of the source you passed.

    I must repeat: no matter which source I use the resulting stochastics value differs from the same stochastics when no source is specified (open(), high(), low(), close(), hl2(), hlc3(), or ohlc4()).
    Again that is because the price series used when no source is passed is different than what is used when you pass a source.

    I can only guess that it is a bug.
    It is not a bug but the intended behavior that extends the capabilities of the function.
    A similar behavior occurs for example in the Donchian Channel. If no source is passed it uses the High and Low for its calculations however if a source is passed it calculates the highest and lowest values of the passed source
    Alex


    Originally posted by waynecd
    Hi,

    As I understand it, as long as you use the same symbol, source, and interval the result of the following stochactics studies should all plot the same:

    Assumption: The default source for stochastics is “default: high, low and close” as stated in the “eSignal EFS Developer’s Reference”. Yet no matter which source I use the resulting stochastics value differs from the same stochastics when no source is specified.

    On a chart displaying the “ES #F” on a 3 minute interval with source for stochastics = hlc3():

    As you can see in the attached chart the values for stochastics for the above “xTypes” differ, (I can't create a table in this post so values are all together)

    Study Type (see basicStoch-test1.efs) StochK Value (see chart) StochD Value (see chart)
    5,3,3 stochastics from "Basic Menu" 30.005 23.48
    xType == "_Std" stochK(5,3,3); 30.005 23.48
    xType == "_inv" stochK(5,3,3,inv(3)); 30.005 23.48
    xType == "_C-inv" stochK(5,3,3,hlc3(inv(3))); 1.85 1.23
    xType == "_C-Sym"stochK(5,3,3,hlc3(sym("ES #F,3"))); 1.85 1.23

    I must repeat: no matter which source I use the resulting stochastics value differs from the same stochastics when no source is specified (open(), high(), low(), close(), hl2(), hlc3(), or ohlc4()).

    I can only guess that it is a bug.

    The page, chart, and test efs are attached in a zip file.

    Thanks

    Comment


    • #3
      Thanks Alex,

      I see that I should never use a "source" because it generates an invalid value as intended by the right way to calculate stochastics.

      Comment


      • #4
        waynecd
        Actually it is not an invalid value. A stochastic is a mathematical process and the Stochastic Oscillator developed by Lane is just one of its implementations (for more information on stochastics see this Wikipedia article).
        The function can serve different purposes such as for example that of normalizing another indicator. Classic implementations of this would be the Stochastic of RSI and the Stochastic of Momentum both of which are widely used studies
        Alex


        Originally posted by waynecd
        Thanks Alex,

        I see that I should never use a "source" because it generates an invalid value as intended by the right way to calculate stochastics.

        Comment

        Working...
        X