- trying to capture values for EMA.5, EMA.10 and SMA.50 and SMA.100
- Trailing stop through the RSI value ??
- Trying to capture the current closed price
wheres the code
Code is below and I am struggling with how to capture the value of RSI so I can build an array...
input int RSIperiod=14; // Period for calculating the RSI. At least that's what the book says
RSIHandle=iRSI(NULL,0,RSIperiod,PRICE_CLOSE);
CopyBuffer(RSIHandle, "What wold go here?",0,17,RSI_ARRAY);
ArraySetAsSeries(RSI_ARRAY,true);
Okkk? So I would do something like....
RSIHandle=iRSI(NULL,0,RSIperiod,PRICE_CLOSE);
int buffer_num;
buffer_num=RSIHandle;
CopyBuffer(RSIHandle,buffer_num,0,17,RSI_ARRAY);
ArraySetAsSeries(RSI_ARRAY,true);
try 0
i assume you only have one buffer....
I have multiple buffers. one for MACD, one for EMA, and one for RSI. I'm attempting to do comparisons on the three arrays copied into these buffers depending on the value of SMA. But I'm not quire sure what you mean by try '0'.
RSI has only 1 buffer, the buffer index always start at 0. So you have to use 0 as second parameter for CopyBuffer.
For EMA, there is always 1 buffer only, so it will be 0 too.
MACD has 2 buffers, main is 0 and signal is 1.
Etc...please read the documentation.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use