Help please with iCustom call

Post Reply
spotdespot
Trader
Posts: 768
Joined: Sun Jan 22, 2012 11:38 pm

Help please with iCustom call

Post by spotdespot »

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" :uff: I thought I had it worked out but ended up just hanging the Empty4 terminal.... :oops:

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
You do not have the required permissions to view the files attached to this post.
User avatar
renexxxx
Trader
Posts: 860
Joined: Sat Dec 31, 2011 3:48 am

Help please with iCustom call

Post by renexxxx »

spotdespot » Sat Oct 04, 2014 7:00 am wrote: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" :uff: I thought I had it worked out but ended up just hanging the Empty4 terminal.... :oops:

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
Hi Dave,

In this case, you are after the fifth buffer value, so the code should be:

Code: Select all

iCustom( Symbol(), Period(), indiname, 4, shift );
where indiname = "TTM waves mtf nmc" and shift is the bar you are interested in (current bar = 0).

Cheers ...
spotdespot
Trader
Posts: 768
Joined: Sun Jan 22, 2012 11:38 pm

Help please with iCustom call

Post by spotdespot »

renexxxx » Fri Oct 03, 2014 10:38 pm wrote: Hi Dave,

In this case, you are after the fifth buffer value, so the code should be:

Code: Select all

iCustom( Symbol(), Period(), indiname, 4, shift );
where indiname = "TTM waves mtf nmc" and shift is the bar you are interested in (current bar = 0).

Cheers ...
Thank you very much René - I really appreciate it.

Thanks,
Dave.
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Help please with iCustom call

Post by SteveHopwood »

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. :arrrg:

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.

:xm:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
spotdespot
Trader
Posts: 768
Joined: Sun Jan 22, 2012 11:38 pm

Help please with iCustom call

Post by spotdespot »

:) Thanks Steve. I know you love indicators :smile:

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. :shock:

I have what I need working now so thanks to you and René.

:!!:

Have a great weekend.

Cheers,
Dave.
Post Reply

Return to “Coders Hangout”