Stochastic - functie

Moderator: Perry

Stochastic - functie

Berichtdoor Paul M » di 12 aug 2003, 14:48

Wie heeft voor mij de Tradestation functie Stochastic?

Paul.
Paul M
 
Berichten: 263
Geregistreerd op: vr 13 dec 2002, 23:21

Stochastic

Berichtdoor Joop Henzen » di 12 aug 2003, 15:00

Hallo Paul



misschien zit ie hier bij ?

http://trader.online.pl/ELZ/t-0-tytulowa-s.html


groet



Joop Henzen
Joop Henzen
 
Berichten: 215
Geregistreerd op: ma 30 dec 2002, 14:21
Woonplaats: Bussum

Stochastic

Berichtdoor Paul M » di 12 aug 2003, 15:34

Hallo Joop,

Bedankt voor de reactie, maar het is niet wat ik zoek.
Ik zoek de volgende Functie:

Stochastic (Function)
The Stochastic oscillators indicate overbought and oversold areas in the market, based upon momentum or price velocity. Stochastic is a multiple-output function that provides the calculation of the values FastK, FastD, SlowK, and SlowD, and the Custom and Orig versions of each.

Function
Stochastic(PriceH, PriceL, PriceC, StochLength, SmoothingLength1, SmoothingLength2, SmoothingType, oFastK, oFastD, oSlowK, oSlowD)

Parameters
PriceH
Specifies the value to use as the high in stochastic calculations.

PriceL
Specifies the value to use as the high in stochastic calculations.

PriceC
Specifies the value to use as the high in stochastic calculations.

StochLength
The trailing number of bars to consider.

SmoothingLength1
The number of bars to consider for the average of the fast K line.

SmoothingLength2
The number of bars to consider for the average of the slow K line.

SmoothingType
?1? will generate calculations based on the original formula, ?2? will conform to legacy TradeStation Pro calculations.

oFastK
Variable that receives the calculation of the fast K line.

oFastD
Variable that receives the calculation of the fast D line.

oSlowK
Variable that receives the calculation of the slow K line.

oSlowD
Variable that receives the calculation of the slow D line.

Paul
Paul M
 
Berichten: 263
Geregistreerd op: vr 13 dec 2002, 23:21

Stochastic

Berichtdoor GMe » di 12 aug 2003, 17:46

{*******************************************************************
Description: This Function returns Slow Stochastic %K Classic
Provided By: Omega Research, Inc. (c) Copyright 1999
********************************************************************}

Inputs: FastKLen(NumericSimple), Length(NumericSimple);

SlowKClassic = Average(FastK(FastKLen), Length);

{*******************************************************************
Description: This Function returns Slow Stochastic %D Classic
Provided By: Omega Research, Inc. (c) Copyright 1999
********************************************************************}

Inputs: FastKLen(NumericSimple), Length(NumericSimple);

SlowDClassic = Average(FastDClassic(FastKLen), Length);

{*******************************************************************
Description: This Function returns FastDClassic
Provided By: Omega Research, Inc. (c) Copyright 1999
********************************************************************}

Inputs : KLength(NumericSimple);

FastDClassic = Average(FastK(KLength), 3);

{*******************************************************************
Description: This Indicator plots a Stochastic with adjustable %K & %D
Provided By: Omega Research, Inc. (c) Copyright 1999 ?
********************************************************************}

Input: Length(5), KAdjust(3), ?DAdjust(3), OverBought(80), OverSold(20);
Variables: KAdjusted(0), DAdjusted(0);

KAdjusted = SlowKClassic(KAdjust, Length);
DAdjusted = SlowDClassic(DAdjust, Length);

IF CurrentBar > Length Then Begin
Plot1(KAdjusted, "%K");
Plot2(DAdjusted, "%D");
End;
Plot3(OverBought, "OverBought");
Plot4(OverSold, "OverSold");

{Alert Criteria}
If Plot1 > OverBought Then
Alert("The %K line is in overbought territory")
Else
If Plot1 < OverSold Then
Alert("The %K line is in oversold territory");

{Stochastics Expert Commentary}
#BeginCmtry
Commentary(ExpertStochastic(Plot1, Plot2, Plot3, Plot4));
#End;
GMe
 
Berichten: 145
Geregistreerd op: zo 07 okt 2001, 16:16

Stochastic

Berichtdoor GMe » di 12 aug 2003, 17:53

{*******************************************************************
Description: This Function returns Slow Stochastic %D Classic
Provided By: Omega Research, Inc. (c) Copyright 1999
********************************************************************}

Inputs: FastKLen(NumericSimple), Length(NumericSimple);

SlowDClassic = Average(FastDClassic(FastKLen), Length);

{*******************************************************************
Description: This Function returns FastDClassic
Provided By: Omega Research, Inc. (c) Copyright 1999
********************************************************************}

Inputs : KLength(NumericSimple);

FastDClassic = Average(FastK(KLength), 3);


{*******************************************************************
Description: This Function returns Slow Stochastic %K Classic
Provided By: Omega Research, Inc. (c) Copyright 1999
********************************************************************}

Inputs: FastKLen(NumericSimple), Length(NumericSimple);

SlowKClassic = Average(FastK(FastKLen), Length);

Variables: KAdjusted(0), DAdjusted(0);

KAdjusted = SlowKClassic(KAdjust, Length);
DAdjusted = SlowDClassic(DAdjust, Length);

IF CurrentBar > Length Then Begin
Plot1(KAdjusted, "%K");
Plot2(DAdjusted, "%D");
End;
Plot3(OverBought, "OverBought");
Plot4(OverSold, "OverSold");

{Alert Criteria}
If Plot1 > OverBought Then
Alert("The %K line is in overbought territory")
Else
If Plot1 < OverSold Then
Alert("The %K line is in oversold territory");

{Stochastics Expert Commentary}
#BeginCmtry
Commentary(ExpertStochastic(Plot1, Plot2, Plot3, Plot4));
#End;
GMe
 
Berichten: 145
Geregistreerd op: zo 07 okt 2001, 16:16

Stochastic

Berichtdoor Paul M » di 12 aug 2003, 19:35

Hallo Geert,

Bedankt voor de snelle reactie.
Maar ze ?zijn het volgens mij niet. ?Ik kwam onderstaande code tegen en daar wordt aan het eind, bij value1 =, de functie Stochastic aangeroepen.
Volgens de help Topics van Tradestation-Pro moet het een functie zijn met volgende parameters.

Function
Stochastic(PriceH, PriceL, PriceC, StochLength, SmoothingLength1, SmoothingLength2, SmoothingType, oFastK, oFastD, oSlowK, oSlowD)



Code:
{
A Smoother Stochastic-RSI
7/21/2003
aspTrader @ TradestationWorld

With thanks to:
- ?Tushar Chande for the idea of plotting a stochastic against the RSI
? AND for the Ravi indicator
- ?? Tillson for T3
- ?Bob Fulks for posting the code for T3 back in 12/1997
- ?Mark Jurik for multiple terrific ideas about creating dynamically adjusted indicators.
}

inputs:
PriceSmoothLength(2),
RaviFastLength(5),
RaviSlowLength(55),
LowRaviLimit(5),
HighRaviLimit(25),
RSILookbackSmoothLength(8),
StochLookbackSmoothLength(8),
LowStochLimit(13),
HighStochLimit(34),
StochSmoothLength1(2),
StochSmoothLength2(2);

variables:
Price(0),
RaviFastValue(0),
RaviSlowValue(0),
Ravi(0),
MaxRavi(2),
MinRavi(10),
RaviStochastic(0),
Depth(0),
RSILookbackLength(0),
DynamicRSI(0),
StochLookbackLength(0),
oFastK( 0 ),
oFastD( 0 ),
oSlowK( 0 ),
oSlowD( 0 ),
StochSmoothingType(1); { pass in 1 for Original, 2 for Legacy }


{ Smooth the price before doing anything... }
Price = T3Average( ( high + low + close + close ) / 4, PriceSmoothLength );

{ Compute Ravi }
RaviFastValue = T3Average( Price, RaviFastLength );
RaviSlowValue = T3Average( Price, RaviSlowLength );
Ravi = absvalue( 100 * ( RaviFastValue - RaviSlowValue ) / RaviSlowLength );

{ Compute maximum and minimum Ravi values and then compute a Stochastic of Ravi }
if Ravi > MaxRavi then
MaxRavi = Ravi
else ifRavi < MinRavi then
MinRavi = Ravi;
RaviStochastic = ( Ravi - MinRavi ) / ( MaxRavi - MinRavi ) ;

{ Compute a dynamic lookback period length for the RSI }
Depth = ceiling( LowRaviLimit + RaviStochastic * (HighRaviLimit - LowRaviLimit) ) ;
RSILookbackLength = T3Average( Depth, RSILookbackSmoothLength );

{ Compute the value of a dynamic RSI }
DynamicRSI = T3Average( RSI( Price, RSILookbackLength), RSILookbackLength ) ;
{ The formula above is a substitute for the BETTER DynamicRSI that requires
?the use of Mark Jurik's RSX indicator as computed below.
? ? See <a href="http://www.jurikres.com" target="_blank">www.jurikres.com</a> for more info. }
?{DynamicRSI = JRC.RSX.flex.2k( Price, RSILookbackLength) ;}

{ Compute a dynamic lookback period length for the Stochastic }
Depth = ceiling( LowStochLimit + RaviStochastic * ( HighStochLimit - LowStochLimit) );
StochLookbackLength = T3Average( Depth, StochLookbackSmoothLength );

{ Compute and plot a Stochastic of the DynamicRSI }
Value1 =
Stochastic(
DynamicRSI, ?
DynamicRSI,
DynamicRSI,
StochLookbackLength,
StochSmoothLength1,
StochSmoothLength2,
StochSmoothingType,
oFastK,
oFastD,
oSlowK,
oSlowD ) ;

plot1(oFastK, "StochRSI" );

Paul
Paul M
 
Berichten: 263
Geregistreerd op: vr 13 dec 2002, 23:21

Stochastic

Berichtdoor GMe » wo 13 aug 2003, 0:22

Het zal er wel aan liggen dat het ding in Tradestation-Pro zit en die heb ik niet.
Overigens ook niet zo erg want er verschijnen dagelijk tientallen nieuwe indicatoren die uiteindelijk weinig toevoegen. Maar we blijven op zoek :)
GMe
 
Berichten: 145
Geregistreerd op: zo 07 okt 2001, 16:16


Keer terug naar Suggesties en vragen

Wie is er online

Gebruikers op dit forum: Geen geregistreerde gebruikers en 19 gasten

cron