Blackjack822:
Hi All. Quick question about this indicator, it shows RSI value on chart window in 6 digits format, what do I have to change or add to make it show only 2 first digits?
Hi,
Use this: NormalizeDouble();
Alain Verleyen:
Thank you and apologize, I'm new in this, still learning ;)
Thank you it worked :)
I've got one more question I'm new in this stuff, can you have a look and tell me if I've done it the long way around? or is there an easier way to do it?
I've got one more question I'm new in this stuff, can you have a look and tell me if I've done it the long way around? or is there an easier way to do it?
#property indicator_chart_window extern int Periods=14; extern int Price=PRICE_CLOSE; extern int Shift=6; int init() { if(ObjectFind("M4X - RSI")!=0) { ObjectCreate("M4X - RSI",OBJ_LABEL,0,0,0,0,0); ObjectSet("M4X - RSI",OBJPROP_XDISTANCE,260); ObjectSet("M4X - RSI",OBJPROP_YDISTANCE,1); } } int start() { int iIndicatorCounted=IndicatorCounted(); if(iIndicatorCounted<0) { return(-1); } int iLimit=Bars-iIndicatorCounted; for(int i=iLimit;i>=0;i--) { double sVal=(dRSI()); if(dRSI()>50 && dRSI()<=70) { ObjectSetText("M4X - RSI", "RSI=" + DoubleToString (sVal,0),8,"Tahoma",White); } else if(dRSI()<50 && dRSI()>=30) { ObjectSetText("M4X - RSI", "RSI=" + DoubleToString (sVal, 0),8,"Tahoma",White); } else if(dRSI()>70 || dRSI()<30) { ObjectSetText("M4X - RSI", "RSI=" + DoubleToString (sVal, 0),8,"Tahoma",White); } else { ObjectSetText("M4X - RSI", "RSI=" + DoubleToString (sVal, 0),8,"Tahoma",CLR_NONE); } } } double dRSI() { return(iRSI(NULL,0,Periods,Price,Shift)); }
Blackjack822:
Thank you it worked :)
I've got one more question I'm new in this stuff, can you have a look and tell me if I've done it the long way around? or is there an easier way to do it?
Thank you it worked :)
I've got one more question I'm new in this stuff, can you have a look and tell me if I've done it the long way around? or is there an easier way to do it?
#property indicator_chart_window extern int Periods=14; extern ENUM_APPLIED_PRICE Price=PRICE_CLOSE; extern int Shift=6; //-------------------------------------------------| int init() { if(ObjectFind("M4X - RSI")!=0) { ObjectCreate("M4X - RSI",OBJ_LABEL,0,0,0,0,0); ObjectSet("M4X - RSI",OBJPROP_XDISTANCE,260); ObjectSet("M4X - RSI",OBJPROP_YDISTANCE,1); } return(0); } //-----------------------------------------| double dRSI() { return(iRSI(NULL,0,Periods,Price,Shift)); } //-----------------------------------------| int start() { int iIndicatorCounted=IndicatorCounted(); if(iIndicatorCounted<0) { return(-1); } string text; double sVal; color cRSI; sVal =(dRSI()); if(dRSI()>50 && dRSI()<=70) { text = StringConcatenate( "RSI=", DoubleToString(sVal,0)); cRSI = clrWhite; } else if(dRSI()<50 && dRSI()>=30) { text = StringConcatenate( "RSI=", DoubleToString(sVal,0)); cRSI = clrWhite; } else if(dRSI()>70 || dRSI()<30) { text = StringConcatenate( "RSI=", DoubleToString(sVal,0)); cRSI = clrWhite; } else { text = ""; cRSI = clrNONE; } ObjectSetText("M4X - RSI",text,8,"Tahoma",cRSI); return(0); })
Alexander Voronkov:
)
Thank you it makes things more clear.)
I wanna ask you something else. I'm using script to hide all the drawings from the chart (fibo, sup. res. etc.) but it also hides the indicator that you've help me with (and I don't want that) but it leaves different one that I've also have on the chart. I've tried to compare both indicators to find some code which prevent one indicator from being hide but no luck and I'm stuck.
Can you help?
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
Hi All. Quick question about this indicator, it shows RSI value on chart window in 6 digits format, what do I have to change or add to make it show only 2 first digits?
------------------------------------------------