[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RT] INDICATOR -- Stochastic on Anything



PureBytes Links

Trading Reference Links


I wanted to look at a stochastic based on 
momentum of prices
and there was not one in my 
library.
 
I wrote this in such a fashion that it runs 
on TS4 and TS2000
(YOU GOTTA USE THE XAverage2 FUNCTION for 
TS4).
 
May not be of any use but I got a kick out 
of the results of
this compared with a conventional 
Stochastic.
 
There is a picture attached which shows the 
difference.
Enjoy.
 
Clyde
 
 
 
 
 
{= = = = = = = = = = = = = = = = = = = = = 
= = = = = = = = = = = =
 
Indicator:  StochasticANY
 
Purpose:    Allow user to 
calculate a Stochastic (raw and 
two            
smoothed versions) on anything that their 
little            
heart desires.  Default is setup using 
Momentum            
and if used with defaults will calculate 
a            
Stochastic of Momentum.
 
<FONT face="Courier New" 
size=2>            The 
raw computation plot can be bypassed by 
setting            
the PlotRaw input to false.
 
<FONT face="Courier New" 
size=2>            BE 
SURE TO SET TYPE PLOT FOR  PLOT4  TO BE 
POINT            
since one plot is used to plot the 20 and 80 lines.
 
Author:     Clyde Lee, 
Copyrighted July, 2001
 
Permissions:  This code may be freely 
copied and 
distributed              
so long as credit to the copyright holder 
is              
included.
 
 = = = = = = = = = = = = = = = = = = = 
= = = = = = = = = = = = = =}
 
Input: 
LoPrice(Momentum(L,30)),       
HiPrice(Momentum(H,30)),       
ClPrice(Momentum(C,30)),       
Length(30),       
SmoLeng1(21),       
SmoLeng2(9),       PlotRaw(false) 
;
 
Variables:  
PriceLo(LoPrice),PriceHi(HiPrice),PriceCl(ClPrice),            
StochRaw(0),StochS1(0),StochS2(0);
 
PriceLo=Loprice;PriceHi=HiPrice;PriceCl=ClPrice;
 
If CurrentBar>=Length then begin  
Value1=Lowest(PriceLo,LENGTH);  
Value2=Highest(PriceHi,LENGTH)-Value1;  StochRaw = 
(PriceCl-Value1)/Iff(Value2<>0,Value2,.001)*100;  If PlotRaw then 
Plot1(StochRaw,"SRaw");  If SmoLeng1>0 then 
begin    StochS1  = 
Iff(CurrentBar=Length,StochRaw,Xaverage2(StochRaw,SmoLeng1)); 
    Plot2(StochS1,"SS1");    If 
SmoLeng2>0 then begin      StochS2  = 
Iff(CurrentBar=Length,StochS1,Xaverage2(StochS1,SmoLeng2)); 
      Plot3(StochS2,"SS2");    
End;  End;End;      If 
Mod(CurrentBar,2)=0   then  Plot4(20,"8020")  else  
Plot4(80,"8020");
 
 
- - - - - - - - - - - - - - - - - - - - 
-  - - - - - - -Clyde Lee   
Chairman/CEO          (Home of 
SwingMachine)SYTECH 
Corporation          email: <A 
href="mailto:clydelee@xxxxxxxxxxxx";>clydelee@xxxxxxxxxxxx  7910 
Westglen, Suite 105       
Office:    (713) 783-9540Houston,  TX  
77063               
Fax:    (713) 783-1092Details 
at:                      
www.theswingmachine.com- - - - 
- - - - - - - - - - - - - - - -  - - - - - - - 
-



To unsubscribe from this group, send an email to:
realtraders-unsubscribe@xxxxxxxxxxxxxxx





Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



Attachment: Description: "junk1.gif"

Attachment: Description: "STOCHANY.ELA"