View Single Post
  #2 (permalink)  
Old 08-14-2007, 11:50 PM
mikeschra's Avatar
mikeschra mikeschra is offline
Junior Member
 
Join Date: Jan 2007
Posts: 9
mikeschra is on a distinguished road
How to code a iCustom indicator

WOW!
After a lot of research I have concluded there is not much information on coding a iCustom indicator, and I never found an example. So I’m going to make my best attempt at explaining what I have found. (Please, any coder out their let me know if any of this info is wrong, just want to make a valuable contribution to this site)

First we need to understand the syntax of the iCustom function. I will be referencing the N4 TF HAS Bar and Heiken Ashi Smoothed indicators in my examples.

iCustom(Symbol,TimeFrame,NameOfiCustomIndicator,Ex ternalUserSetVariables,Mode,Shift)

Symbol: is the currency pair you want to work with. NULL means current symbol of the chart you have your EA attached to. So the syntax code starts like this: iCustom(Null

TimeFrame: The chart time frame you want to work with. 0 means current time frame of the chart your EA is attached to. Continued syntax code adding the TimeFrame: iCustom(Null,0

NameOfiCustomIndicator: The name of the Icustom indicator you are using. In my example it will be “N4 TF HAS Bar”. Use quotations before and after the name. Continued syntax code adding the NameOfiCustomIndicator: iCustom(Null,0, “N4 TF HAS Bar”

ExternalUserSetVariables: This is all of the extern parameters of the indicator you are using listed in order they appear in the code of the indicator. In our case we are using the N4 TF HAS Bar indicator. Open this indicator code in MetaEditor and you will find the following code:
extern int MaMetod = 2;
extern int MaPeriod = 6;
extern int MaMetod2 = 3;
extern int MaPeriod2 = 2;
extern int BarWidth = 0;
extern color BarColorUp = Blue;
extern color BarColorDown = Red;
extern color TextColor = White;
extern int MaxBars=500;
Every extern parameter now needs to be included in the syntax code IN THE ORDER LISTED IN THE INDICATOR CODE. Continued syntax code adding the ExternalUserSetVariables: iCustom(Null,0, “N4 TF HAS Bar”,MaMetod,MaPeriod,MaMetod2,MaPeriod2,BarWidth, BarColorUp,BarColorDown,TextColor,MaxBars

The mode parameter needs a close look at so we will continue this in the next post.
Reply With Quote