Hsuani Chen: The document I can't understand..:(
Why can't you?
Following the example you get:The buffer numbers: 0 - MAIN_LINE, 1 - SIGNAL_LINE
those are defined in Standard Constants, Enumerations and Structures / Indicator Constants / Indicators Lines - Reference on algorithmic/automated trading language for MetaTrader 5 int handle; int OnInit(){ handle=iStochastic(_Symbol,_Period,8,3,3,MODE_SMA,STO_LOWHIGH); : void OnCalculate(...){ : int amount = rates_total-prev_calculated+1; if(CopyBuffer(ind_handle,MAIN_LINE,0,amount,kline)<0) ... if(CopyBuffer(ind_handle,SIGNAL_LINE,0,amount,dline)<0) ...
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I have a MQL4 code:
for(int i = 0;i < 3;i++)
{
kline[i] = iStochastic(NULL, Period(), 8, 3, 3, MODE_SMA, 0, MODE_MAIN, i);
dline[i] = iStochastic(NULL, Period(), 8, 3, 3, MODE_SMA, 0, MODE_SIGNAL, i);
}
But MQL5 dones't have MODE_MAIN and MODE_SIGNAL.
How should I get this result at MQL5?
The document I can't understand..:(
Please help me.
Thanks.