- MQL5 Wizard: Development of trading robots for MetaTrader 5
- MetaEditor - Professional editor of trading applications
- Objects - Chart - MetaTrader 5 for iPhone
Have you written some code?
Look to my template of arrow indicator with alert.
https://www.mql5.com/ru/code/14173
- votes: 17
- 2015.11.16
- Vasyl Nosal
- www.mql5.com
Than change "main" to this
//main double rsi,rsi_prev; for(int i=all-counted;i>=0;i--) { if(i>Bars-20) i=Bars-20; if(i==0) { up_arr[i]=EMPTY_VALUE; down_arr[i]=EMPTY_VALUE; } rsi=iRSI(Symbol(),0,14,PRICE_CLOSE,i); rsi_prev=iRSI(Symbol(),0,14,PRICE_CLOSE,i+1); if(rsi_prev<=20 && rsi>20) up_arr[i]=Low[i]-arrow_indent*Point; //up arrow if(rsi_prev>=80 && rsi<80) down_arr[i]=High[i]+arrow_indent*Point; //down arrow }
You will have arrows on rsi crossing+alert.
Hope you will deal and understand logic of crossing. You nned to compare previous data of rsi and current with level.
This is exactly what I was looking for. I was trying to add the alert and crossover detection within the code for the RSI. Now here is another question for you. I was thinking if I had the base start I could add the other part in of what I want since it is just another alert upon crossing but it is also dependent on the RSI. So this is what I added to MAIN. I keep getting errors naturally. So what is going on here I apologize for my inexperience. My programming experience dealt with microprocessors and low level languages. I obviously am having a difficult time with Object oriented languages, this on in particular.
The idea here is the have the arrow and/or the alert when both the RSI and CCI cross a certain range at a certain time.
//main double rsi,rsi_prev,cci,cci_prev; for(int i=all-counted;i>=0;i--) { if(i>Bars-20) i=Bars-20; if(i==0) { up_arr[i]=EMPTY_VALUE; down_arr[i]=EMPTY_VALUE; } rsi=iRSI(Symbol(),0,14,PRICE_CLOSE,i); rsi_prev=iRSI(Symbol(),0,14,PRICE_CLOSE,i+1); cci=iCCI(Symbol(),0,14, PRICE_CLOSE1,i); cci_prev=iCCI(Symbol(),0,14,PRICE_CLOSE1,i+1); if(rsi_prev<=45 && rsi>=50) && (cci_prev<=-5 && cci>=0) up_arr[i]=Low[i]-arrow_indent*Point; //up arrow if(rsi_prev>=55 && rsi<50) && (cci_prev>=5 && cci<=0) down_arr[i]=High[i]+arrow_indent*Point; //down arrow }
You need to show errors.
CLOSE1
delete "1"
'arrows_template2.mq4' arrows_template2.mq4 Line 1 Column 1 '&&' - operand expected arrows_template2.mq4 Line 102 Column 30 'up_arr' - some operator expected arrows_template2.mq4 Line 102 Column 58 expression has no effect arrows_template2.mq4 Line 102 Column 47 expression has no effect arrows_template2.mq4 Line 102 Column 74 '&&' - operand expected arrows_template2.mq4 Line 103 Column 29 'down_arr' - some operator expected arrows_template2.mq4 Line 103 Column56 expression has no effect arrows_template2.mq4 Line 103 Column45 expression has no effect arrows_template2.mq4 Line103 Column 75 4 error(s), 4 warning(s) 5 5
Here are the errors. I've gotten a few to go away but still having issues with these. Is my thinking correct with what I have added in the last post to MAIN?
Here are the errors. I've gotten a few to go away but still having issues with these. Is my thinking correct with what I have added in the last post to MAIN?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use