krishna79 Posted June 1, 2012 Report Posted June 1, 2012 Hi, I am looking for a indicator which display percentage increase or decrease in current price with YESTERDAY close. Hope experts out here help me. Thank you Kisna
⭐ luxinterior Posted June 1, 2012 Report Posted June 1, 2012 I think you're missing a variable. Do you mean percentage of yesterdays range? Increase or decrease from yesterdays close wouldn't be possible as you don't have a range from which to gauge a percentage increase/decrease. For example if yesterdays close was 10 and today is 12 what percentage would that be? Hope that makes sense. Lux krishna79 1
krishna79 Posted June 1, 2012 Author Report Posted June 1, 2012 Hi sir, I have the formula Yesterday close = 4921 (A) Current price (LTP) = 4863 (B) 1. Percentage = ((B-A)/B)*100 2. Price difference = B - A Hope i have clarified kisna
⭐ luxinterior Posted June 1, 2012 Report Posted June 1, 2012 (edited) What does LTP stand for? Put this together quickly based on your above formula but not sure what it's supposed to be showing. //+------------------------------------------------------------------+ //| #krishna79.mq4 | //| //+------------------------------------------------------------------+ /* Yesterday close = 4921 (A) Current price (LTP) = 4863 (B) 1. Percentage = ((B-A)/B)*100 2. Price difference = B - A */ #property indicator_chart_window //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { //---- static double dYesterdaysClose; // check for new day if(dYesterdaysClose == 0 || NewDay()){ dYesterdaysClose = iClose(Symbol(),PERIOD_D1,1); } Comment(DoubleToStr(((dYesterdaysClose-Bid)/Bid)*100,2)); //---- return(0); } //+------------------------------------------------------------------+ bool NewDay(){ static datetime LastTime = 0; if (iTime(Symbol(),PERIOD_D1,0) != LastTime) { LastTime = iTime(Symbol(),PERIOD_D1,0) ; return (true); } else return (false); } Lux Edited June 1, 2012 by luxinterior
krishna79 Posted June 1, 2012 Author Report Posted June 1, 2012 Ltp = Last Traded Price Thank u sir. I will check.. How to compile it to mq4 file
shabz Posted June 1, 2012 Report Posted June 1, 2012 (edited) Try this indicator, it has been done before: http://www.4shared.com/file/nTAfTxML/DailyChange_Rev1.html Compares yesterdays closing price to current bid price as a percentage fall or rise. Enjoy. Edited June 1, 2012 by shabz krishna79 1
krishna79 Posted June 1, 2012 Author Report Posted June 1, 2012 Thank you shabz & lux for your support
shabz Posted June 1, 2012 Report Posted June 1, 2012 (edited) Google search "bid view mt4" for a comprehensive indicator showing current price, highs, lows, pip change, percent change etc. Please use the thanks button. Edited June 1, 2012 by shabz krishna79 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now