calling custom indicator

 

in metastock we call a custom indicator by using fml("custom name") but there does not seem a similar method here....

there are countless examples of calling the standard inticators,, such as,,

--------------------------

MacdPrevious = iMACD(NULL, 1440, 12, 26, 9, PRICE_CLOSE, MODE_MAIN, 1);

MacdPrevious2 = iMACD(NULL, 1440, 12, 26, 9, PRICE_CLOSE, MODE_MAIN, 2);

OsMAPrevious = iOsMA(NULL, 1440, 12, 26, 9, PRICE_CLOSE, 1);

OsMAPrevious2 = iOsMA(NULL, 1440, 12, 26, 9, PRICE_CLOSE, 2);

Williams = iWPR(NULL, 1440, WilliamsP, 1);

---------------------------------------------

but can't seem to find any example of calling my own indicator....

can anyone recall seeing an example.... i can strip out the code needed if someone has an example..... thanks.....h

 

You can call one using the iCustom function. Many times it is better to build an EA with the custom indicator logic in it rather than calling it. Can be more reliable.

Jon

 

hey mazoem.... perfect..... for some reason kept overlooking that term....

calling an indicator, hull ma, for an ea is just what i'm trying to do.... until i better understand the coding frame work it might be easier for me to just call the ready made formula....

in metastock i could rip it out the whole deal in just a couple minutes tops, but i'm very very new to mql4..... trying to convert some of my trading systems from metastock to mql4 is proving quite a task..... thanks again.....h

 
hayseed:
hey mazoem.... perfect..... for some reason kept overlooking that term.... calling an indicator, hull ma, for an ea is just what i'm trying to do.... until i better understand the coding frame work it might be easier for me to just call the ready made formula.... in metastock i could rip it out the whole deal in just a couple minutes tops, but i'm very very new to mql4..... trying to convert some of my trading systems from metastock to mql4 is proving quite a task..... thanks again.....h

Glad that helped.

You may also goto MQL4 Documentation: expert advisors, custom indicators, scripts and libraries to learn more.

I also gathered all these lessons and compiled them into one .pdf. It has been very usfull (attached)

Jon

Files: