| New signals service! | |
|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
![]() |
|
|
LinkBack (2) | Thread Tools | Display Modes |
|
||||
|
How do I limit the amount of decimal places a comment statement shows on the graph. Right now it shows a variable result as .00347892, and I want it only to show .0035 (Rounded to the next number)??
Appreciate your input! Dave |
|
|||
|
iCustom( string symbol, int timeframe, string name, ..., int mode, int shift)
'mode' is your buffer iCustom( ... ...indicator parameters here ... , 0, currentBar) - will read from 0 buffer iCustom( ... ...indicator parameters here ... , 1, currentBar) - will read from 1st buffer some info here http://docs.mql4.com/indicators/iCustom lowestFG=9999 should be OK but to be sure can write lowestFG = iCustom(NULL,0,"Forex-Grail Trade Indicator",period,PRICE_CLOSE,1,currentBar) instead DoubleToStr function(http://docs.mql4.com/convert/DoubleToStr) will limit # of decimal places, mostly used to get nice looking # fro Print or Alert function. The function will not round but simply cut off unneeded decimal places. If you use your this double # to compare with another # you still have bunch of # after decimal point use NormalizeDouble (http://docs.mql4.com/convert/NormalizeDouble) to limit number if decimal places permanently according to your iCustom your indicator have 2 parameters period and price(PRICE_CLOSE), check if thats correct Last edited by asmdev; 03-21-2007 at 11:06 PM. |
|
|||
|
Quote:
|
|
|||
|
possible solution for 0 buffer:
int currentBar=0; double lowestFG=iCustom(NULL,0,"Forex-Grail Trade Indicator",period,PRICE_CLOSE,0, currentBar); double highestFG = lowestFG; for(;currentBar<4; currentBar++) lowestFG=MathMin(lowestFG, iCustom(NULL,0,"Forex-Grail Trade Indicator",period,PRICE_CLOSE,0,currentBar)); for(currentBar=0;currentBar<4; currentBar++) highestFG =MathMax(highestFG , iCustom(NULL,0,"Forex-Grail Trade Indicator",period,PRICE_CLOSE,0,currentBar)); you need to do all over again for buffer # 1 |
|
|||
|
Quote:
|
|
||||
|
First of all, I would like to thank all of you for helping me. I believe I can now put my new EA on line for testing.
I still have a question on decimal places. The comment statement is being generated from the EA and not the indicator. The function indicatordigits, I believe, is used in the indicator itself and not the ea. Is there not a simple rounding off up to x places of a variable that I could use. Why they make this language so complicated. Even basic language could probably do this! As always appreciated, feedback of knowledge and wisdom is welcome. Please help if you can. Thanks a bunch! |
![]() |
| Bookmarks |
| Tags |
| histogram, forex, ZUP_v1.mq4 |
| Thread Tools | |
| Display Modes | |
|
|
LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/questions/270-ask.html
|
||||
| Posted By | For | Type | Date | |
| OzFx System:) - Page 639 | This thread | Refback | 06-21-2008 10:53 PM | |
| Forex SRDC Sidus Sibkis EA MT4 Forum OTCSmart | This thread | Refback | 12-08-2007 12:46 PM | |