How to use the stochastics ?

Created at 04 Mar 2013, 13:40
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
condor's avatar

condor

Joined 28.02.2013

How to use the stochastics ?
04 Mar 2013, 13:40


How can i use the Stochastics in a robot ?

I declare it like this

private StochasticOscillator Stoch;
Stoch = Indicators.StochasticOscillator( 9, 3, 9, MovingAverageType.Exponential);

But after that how can i access to Stoch's signal and main lines ?


@condor
Replies

cAlgo_Fanatic
04 Mar 2013, 15:06 ( Updated at: 21 Dec 2023, 09:20 )

You may access it as follows:

    Stoch.PercentK.LastValue;  // Last value of Main
    Stoch.PercentD.LastValue;  // Last value of Signal
    // or
    int index = MarketSeries.Close.Count - 1; // index of last bar
    Stoch.PercentK[index - 1]; // Previous to last value of Main
    Stoch.PercentD[index - 1]; // Previous to last value of Signal



The instellisense will populate a list of all properties upot pressing the period (dot):


@cAlgo_Fanatic

condor
04 Mar 2013, 15:41

Thank you, i've seen it but i hadn't understood that PercentK was Main.


@condor

crank
27 Dec 2014, 17:26 ( Updated at: 21 Dec 2023, 09:20 )

RE:

How do I use PercentK for two different symbols?

You may access it as follows:

    Stoch.PercentK.LastValue;  // Last value of Main
    Stoch.PercentD.LastValue;  // Last value of Signal
    // or
    int index = MarketSeries.Close.Count - 1; // index of last bar
    Stoch.PercentK[index - 1]; // Previous to last value of Main
    Stoch.PercentD[index - 1]; // Previous to last value of Signal


 

The instellisense will populate a list of all properties upot pressing the period (dot):

 


@crank