Proper Stoch indicator usage

Posted By: Pork

Proper Stoch indicator usage - 09/24/13 18:23

The manual says Stoch(int FastK_Period, int SlowK_Period, int SlowK_MAType, int SlowD_Period, int SlowD_MAType)....
Uses the current asset price series. Returns: rSlowK, rSlowD.
If I create a price series like so:
vars Sto=series(Stoch(5,3,MAType_SMA,3,MAType_SMA));
what does s equal if I say:
s=Sto[0]
do i get the rSlowK or the rSlowD or are they retrieved another way?
Thanks
P
Posted By: swingtraderkk

Re: Proper Stoch indicator usage - 09/24/13 19:39

Pork,

call stoch and create a series out of the returned rSlowK & rSlowD

Code:
Stoch(5,3,MAType_SMA,3,MAType_SMA);

vars k = series(rSlowK);
vars d = series(rSlowD);

Posted By: blaub4r

Re: Proper Stoch indicator usage - 09/24/13 20:31

Do what swingtraderkk says.
The Stoch function seems to have no return value hence your code should not work anyway.
rSlowK and rSlowD are global variables which are manipulated by the Stoch function.
Posted By: Pork

Re: Proper Stoch indicator usage - 09/25/13 10:46

Great Thanks for the help!
@blaub4r Stoch does seem to return something when I use it, but it wasn't what I expected. So this should explain that issue.
P
© 2024 lite-C Forums