krishna79 Posted June 1, 2012 Report Share 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 Quote Link to comment Share on other sites More sharing options...
⭐ luxinterior Posted June 1, 2012 Report Share 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 Quote Link to comment Share on other sites More sharing options...
krishna79 Posted June 1, 2012 Author Report Share 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 Quote Link to comment Share on other sites More sharing options...
⭐ luxinterior Posted June 1, 2012 Report Share 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 Quote Link to comment Share on other sites More sharing options...
krishna79 Posted June 1, 2012 Author Report Share Posted June 1, 2012 Ltp = Last Traded Price Thank u sir. I will check.. How to compile it to mq4 file Quote Link to comment Share on other sites More sharing options...
shabz Posted June 1, 2012 Report Share 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 Quote Link to comment Share on other sites More sharing options...
krishna79 Posted June 1, 2012 Author Report Share Posted June 1, 2012 Thank you shabz & lux for your support Quote Link to comment Share on other sites More sharing options...
shabz Posted June 1, 2012 Report Share 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.