Hi,
1. You can not use any trading functions within the Indicator.
2. You can not make the EA from indi, just putting trading functionality inside. These are 2 different types of program.
Your new "EA" has an indicator icon and quality, because it has #property indicator_chart_window string in it, and plots lines.
If you want to build an EA based on custom indi, you should create new file with EA and use indicator via iCustom function.
Hope it helps.

- www.mql5.com
example:
double rsi_chart = iRSI(symbol[0],PERIOD_CURRENT,10, PRICE_CLOSE) ; if( rsi_chart > 70 ){ OpenFromMarket(ORDER_TYPE_BUY) ; }
When the RSI value is more then 70. Start long trade.
But it is not giving me the right RSI value.. Because it trades anyway..
So maybe the rsi_chart has to be int. So do i did:
int moment_int = (int) moment_chart ; int rsi_int = (int) rsi_chart ;
But that is also not working or am i taking the wrong price, 'PRICE_CLOSE' ?
The RSI chart is showing good in the backtest but the EA is not trading on the RSI outcome..
well, you better refer to the CopyBuffer function in the documentation page.
The basic procedure processing indicators looks as following.
1. You declare a handle (Global Scope)
int handle=-1;
2. You initialize the handle (OnInit function)
handle= iRSI(_Symbol,PERIOD_CURRENT,10, PRICE_CLOSE) ;
You can also then check if your handle is not INVALID_HANDLE
3. You get the value from the indicator's buffer (OnTick function or whenever you need it)
double rsi[1]={0}; CopyBuffer(handle,.......,rsi);
and you can also check how many elements were copied etc etc.
Refer to the documentation for more info.

- www.mql5.com
Yes i figured it out.. It is (almost) the same as you did with the iEnvelops, it needs his history to work properly.
And it works now. thks
Yes i figured it out.. It is (almost) the same as you did with the iEnvelops, it needs his history to work properly.
And it works now. thks

- 2009.11.23
- Андрей
- www.mql5.com
// rsi point double get_rsi(int handle,int bar) { double rsi_line[1]={0}; CopyBuffer(handle,0 ,bar,1,rsi_line); return(rsi_line[0]); } // if last point rsi value > (bigger then) the point before last rsi value ) { if( get_rsi(handles_rsi[i], 0 ) > get_rsi(handles_rsi[i], 1 ) ) { int rsi_go = 1 ; }
Is this right? Because it trades sometimes a bit weird..
Or is is because 'get_rsi(handles_rsi[i], 0 )' is the point that is still to be set on a value, and is still fluctuating up and down?
There are 2 options. You either use points 2&1 instead of 1&0 or you build your RSI based on PRICE_OPEN instead of PRICE_CLOSE

- www.mql5.com
Ah ok, i thought maybe i used the wrong values from the indicator or it was the changing bar, it was the last one.
Now i use PRICE_OPEN and the results are much more stable.
Getting information from standard inducators like iMomentum/iRSI and so on i can handle.
But from iCustom is now just a bit to early i think. I cant get the right value from the indicator to the ea by copybuffer.
It will figure it out if the time is right.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I tried to make an EA from a indicator.
I took the basics of the indicator and added the necessary stuff to make a trade in some of the indicator points.
And now it error free within the MetaEditor. But now i want to backtest te EA but it is still showing the indicator image in MT5. So it won't let it backtest the EA.
See the attachment. The Envelops_ea has the good icon but the Beginner_ea is still showing the indicator image..
Ive tried to copy the code in a new window of a exitsting EA but that also does not work. How can i solve this problem?