Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.
From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.
Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
Elite Section
Get access to private discussions, specialized support, indicators and trading systems reported every week.
Advanced Elite Section
For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
double lowestFG=9999, highestFG=-9999; int currentBar=0; int lastBar=4; for(currentBar=0;currentBar<lastBar; currentBar++) lowestFG=MathMin(lowestFG, iCustom(NULL,0,"Forex-Grail Trade Indicator",period,PRICE_CLOSE,currentBar)); Print ("Low =",lowestFG);
This reads from buffer ' 0 ' of the indicator [0.00 to positive] (Works OK!). How do I get it to read from buffer ' 1 ' of the indicator [0.00 to negative]?
Statement definition: double iCustom( string symbol, int timeframe, string name, ..., int mode, int shift) - No where does it call for a buffer number?????????????? PLEASE HELP!!!! It seems to be locked into buffer ' 0 '.
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)??
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
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
This reads from buffer ' 0 ' of the indicator [0.00 to positive] (Works OK!).
it is coincidence that it works ok, If your FG indicator has 2 pameters (period & price) you need to add 1 more param in the iCustom like in prev post, if your FG indicator has 1 param(period) then replace PRICE_CLOSE with buffer #(0 or 1 or 2 or ...)
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)??
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.