| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| Help please with iCustom call https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3858 |
Page 1 of 1 |
| Author: | spotdespot [ Fri Oct 03, 2014 9:00 pm ] |
| Post subject: | Help please with iCustom call |
Hi Guys, Could anyone point me in the right direction for returning the current bar value from the attached indicator please with an iCustom call? I am sure this is pretty basic for a lot of people but I find the MQL "help" less than useful as a "non-coder" I just need to use the default parameters for the indicator. I just want to compare the current bar with the current bar value with the previous (i.e. to work out up or down). Any help much appreciated. Thanks, Dave. EDIT: cool indi btw - courtesy of the Indi gurus @ forex-tsd - mladen & co |
|
| Author: | renexxxx [ Fri Oct 03, 2014 9:38 pm ] |
| Post subject: | Help please with iCustom call |
Hi Dave, In this case, you are after the fifth buffer value, so the code should be: Code: Select all Cheers ... |
|
| Author: | spotdespot [ Fri Oct 03, 2014 9:46 pm ] |
| Post subject: | Help please with iCustom call |
Thank you very much René - I really appreciate it. Thanks, Dave. |
|
| Author: | SteveHopwood [ Fri Oct 03, 2014 10:01 pm ] |
| Post subject: | Help please with iCustom call |
Do you know that Crap Custom Abortions's store their information in 'buffers' starting at index 0? The first buffer in the data window is H1 TTM Wave - this is buffer 0. After that, Value 2 is buffer 1, Value 3 is buffer 2 etc. Bloody infuriating. A particular cca will assign different buffers to different colours. Red may be buffer 0, green may be buffer 1 - it is the coders' choice. So, when you interrogate a cca you interrogate individual buffers. If buffer 0 holds a non-zero or non EMPTY_VALUE, then the thingy it is showing will be red. Bad enough, but to make thingies even better you have to work out which method of showing a non-value the coder is using in a buffer. Sometimes they use EMPTY_VALUE which is a constant for 2147483647. Sometimes they use zero. The stupid bastards who code the worst examples of this rubbish sometimes use a mixture. I see from the source code that this particular cca uses EMPTY_VALUE. Looking at this in the Data window, it appears that buffer 2 (i.e. value 3) holds a non-empty value when the histo is light blue. Only appears mind; these things have a habit of not playing fair. So, at an appropriate point in my code I would have defined a colour constant: #define lightblue "Light Blue" and defined an cca colour variable to use throughout my code: string CcaColour = ""; Then, in the function that reads the cca (ReadIndicatorValues() in all my shells) doubl CcaVal = iCustom(Symbol(), 0, "TTM waves mtf nmc", <list of comma-separated cca external indis>, 2, 0); The red highlighted 2 is the buffer I am interrogating. The blue highlighted 0 is the candle I want the data returned for. 0 means now, 1 means the close 1 candle ago etc. Then: If (CcaVal != EMPTY_VALUE) CcaColour = lightblue; It probably won't be as simple as that - it rarely is. Crap Custom Abortion is not an affectionately humorous epithet applied to a much loved genre. Mostly, they are crap. Not every indi coder is a moron. Some are exceptionally brilliant. If you do have to deal with Custom Indicators, pray they were coded by Baluda, Squalou, Swingman of Tommaso. |
|
| Author: | spotdespot [ Fri Oct 03, 2014 10:13 pm ] |
| Post subject: | Help please with iCustom call |
The guy who wrote this particular indicator has written some amazing stuff - kind of an indi version of you in that he churns out indi's like you do EA's, seemingly with little effort. I have what I need working now so thanks to you and René. Have a great weekend. Cheers, Dave. |
|
| All times are UTC | Page 1 of 1 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|