Need help to convert formula

 

Hi, I need to replace iRsi in this formula with iStochastic.

double rsi  = (iRsi(rwma,RsiPeriod,i,rates_total,0)-50)*0.5;

I don't know how to exactly set the iStochastic formula. I tried using this, but it doesn't work:

double rsi = (iStochastic(rwma,RsiPeriod,5,3,3,MODE_SMA,STO_LOWHIGH,i,rates_total,0))*0.5;


Could someone help me? Thank you...

 
  1. Why did you post your MT4 question in the Root / MT5 Indicators section instead of the MQL4 section, (bottom of the Root page?)
              General rules and best pratices of the Forum. - General - MQL5 programming forum
    Next time post in the correct place. The moderators will likely move this thread there soon.

  2. When you post code please use the CODE button (Alt-S)! (For large amounts of code, attach it.) Please edit your post.
              General rules and best pratices of the Forum. - General - MQL5 programming forum
              Messages Editor

  3. What do you mean you "don't know how?" Perhaps you should read the manual.
              iStochastic - Technical Indicators - MQL4 Reference

  4. "Doesn't work" is meaningless - just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires - meaningless.
  5. Bogus call:
    Your code
    Documentation
    double rsi = (iStochastic(
       rwma,
       RsiPeriod,
       5,
       3,
       3,
       MODE_SMA,
       STO_LOWHIGH,
    //{
       i,
       rates_total,
    //}
       0
    ))*0.5
    double  iStochastic(
       string       symbol,           // symbol
       int          timeframe,        // timeframe
       int          Kperiod,          // K line period
       int          Dperiod,          // D line period
       int          slowing,          // slowing
       int          method,           // averaging method
       int          price_field,      // price (Low/High or Close/Close)
    //{
       int          mode,             // line index
                                                   
    //}
       int          shift             // shift
       );
    1. I assume STO_LOWHIGH is zero.
    2. You have i and rates_total, the call has only one argument and neither are MODE_MAIN, or MODE_SIGNAL.
  6. On MT4: Unless the current chart is that specific pair/TF referenced, you must handle 4066/4073 errors.
              Download history in MQL4 EA - MQL4 and MetaTrader 4 - MQL4 programming forum

  7. Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using CODE button) and state the nature of your problem.
              No free help
              urgent help.

 
jox90:

Hi, I need to replace iRsi in this formula with iStochastic.

perhaps, read the manual?
https://docs.mql4.com/indicators/istochastic

iStochastic - Technical Indicators - MQL4 Reference
iStochastic - Technical Indicators - MQL4 Reference
  • docs.mql4.com
iStochastic - Technical Indicators - MQL4 Reference
 
jox90:

Hi, I need to replace iRsi in this formula with iStochastic.

double rsi  = (iRsi(rwma,RsiPeriod,i,rates_total,0)-50)*0.5;

I don't know how to exactly set the iStochastic formula. I tried using this, but it doesn't work:

double rsi = (iStochastic(rwma,RsiPeriod,5,3,3,MODE_SMA,STO_LOWHIGH,i,rates_total,0))*0.5;


Could someone help me? Thank you...

First of all : that rsi is not the built in rsi. 

Also you can not just replace one with the other - built in stochastic is working in completely different way than that custom rsi.

 
Mladen Rakic:

First of all : that rsi is not the built in rsi. 

Also you can not just replace one with the other - built in stochastic is working in completely different way than that custom rsi.

ok. thank you.

Reason: