I have an indicator which compares several values. I wish to bring those values into my EA. So far, what I've found, of the use of iCustom function is; calling the name of the indicator and comparing two different time periods of the same MA. How would I use iCustom to compare two different values of the same indicator.
For example:
Let's say that I have an MA of the average of the High and Low for a 15 min Period, and a MA of Close Price over 13 Periods, in the same Indicator. Let's say that I want to place a Buy, in my EA, when the MA of the Close Price crosses under the MA of the average of High/ Low, in the Indicator.
How would I utilize the iCustom Function to capture a state which occurs between two different MAs in the same Indicator?
You just read the different indicators in your EA using icustom and do a compare
val1 = iCustom(NULL, 0,"sar_filter_alert",5,9,3,3,1,1,0.02,0.2,0,0);
val2 = iCustom(NULL, 0,"AsciiTrade",10,20,5,0,0);
Then if(val1 > val2 etc
or if you want to compare 2 values in the same indicator, change the values in the second read
val1 = iCustom(NULL, 0,"sar_filter_alert",5,9,3,3,1,1,0,0);
val2 = iCustom(NULL, 0,"sar_filter_alert",25,19,3,3,1,3,1,0);
No comments:
Post a Comment