| / | Forum |
|
forexman05
2007.10.16 02:51
Can anyone shed some light on how I can incorporate a custom indicator into my order send functions in my EA? I have the custom indicator and want to call on it with the EA.....any help would be greatly appreciated! Custom indicator resembles... ... //+------------------------------------------------------------------+ //| Support and Resistance | //| Copyright © 2004 Barry Stander | //| http://myweb.absa.co.za/stander/4meta/ | //+------------------------------------------------------------------+ #property copyright "Click here: Barry Stander" #property link "http://myweb.absa.co.za/stander/4meta/" #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Red #property indicator_color2 Blue //---- buffers double v1[]; double v2[]; double val1; double val2; int i; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int init() { //---- drawing settings SetIndexArrow(0, 119); SetIndexArrow(1, 119); //---- SetIndexStyle(0, DRAW_ARROW, STYLE_DOT, 1); SetIndexDrawBegin(0, i-1); SetIndexBuffer(0, v1); SetIndexLabel(0,"Resistance"); //---- SetIndexStyle(1,DRAW_ARROW,STYLE_DOT,1); SetIndexDrawBegin(1,i-1); SetIndexBuffer(1, v2); SetIndexLabel(1,"Support"); //---- return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int start() { i = Bars; while(i >= 0) { val1 = iFractals(NULL, 0, MODE_UPPER, i); //---- if(val1 > 0) v1[i] = High[i]; else v1[i] = v1[i+1]; val2 = iFractals(NULL, 0, MODE_LOWER, i); //---- if(val2 > 0) v2[i] = Low[i]; else v2[i] = v2[i+1]; i--; } return(0); } //+------------------------------------------------------------------+need this to return a value for the support and a value for the resistance...... .thanks!!!!! |
|
Universal Expert Advisor Template The article will help newbies in trading to create flexibly adjustable Expert Advisors. |
|
phy
2007.10.16 04:52
See iCustom() |
|
forexman05
2007.10.16 05:38
Do I call val 1 and val 2 for the actual values or is it v1 and v2? I noticed the
support and resistance values show up after a few bars......
|
|
phy
2007.10.16 18:24
iCustom requests the value of an indicator index, numbered 0 through 7. Look at indicator code and request the value of the index you are interested in obtaining
|
|
forexman05
2007.10.21 22:17
phy wrote:
iCustom requests the value of an indicator index, numbered 0 through 7. Look at indicator code and request the value of the index you are interested in obtaining
What would this look like for the indicator I put up above? Sorry, I am a little confused on what needs to go into all the places for the iCustom funciton. I understand we need to use this function, but I cannot decipher what needs to be done from there. Also is this put in as Normalizedouble or double? Please help..... |
|
phy
2007.10.21 22:49
"Can anyone shed some light on how I can incorporate a custom indicator into my order send functions in my EA? I have the custom indicator and want to call on it with the EA" You "call" the custom indicator code and ask it to hand you its values via the iCustom() call. It is not necessary to "incorporate" an indicator into your EA. The indicator above has two indexes , named Resistance and Support in use. The iCustom
call will reference index 0 or index 1, that is, 0 or 1, in the "mode"
"I am a little confused on what needs to go into all the places for the iCustom funciton." That is why all the commands are defined in the documentation. Play around with
code and find out how things work. Write tiny programs to explore "Also is this put in as Normalizedouble or double? " Is what put in? NormalizeDouble is necessary to limit the number of digits in the fractional part
of decimal numbers before comparing them for equality. A second use is |
|
DxdCn
2007.10.22 06:09
, string name, ...,
|