Quote:
|
Originally Posted by jpsdyb
Just curious as to how, I can add an indicator (i-trend) to an expert and create settings that if the indicator passes certain values in I-trend , to not enter a trade.
If can help or point me in right direction.
Thank you
|
jpsdyb,
I think the best way is iCustom function:
Read this piece of one of my articles:
There are two kinds of indicators you can use in your code (Expert advisors, Custom indicators and scripts):
Built-in indicators:
The MQL4 has a number of built-in indicators which you can use them in your code directly as a function for example:
double iMA( string symbol, int timeframe, int period, int ma_shift, int ma_method, int applied_price, int shift)
The above code calculates the moving average indicator and returns its value.
double iATR( string symbol, int timeframe, int period, int shift)
The above code calculates the average true range indicator and returns its value.
Any other indicator:
To use any other indicator in your code (I-Trend for example) you have to duplicate the code of this indicator in your code (it the hell way) or you can use the iCustom function:
double iCustom( string symbol, int timeframe, string name, ... , int mode, int shift)
What's iCustom anyway?
iCustom is a MQL4 function enables you to use external indicators in your expert advisor or custom indicator code without re-writing the code from scratch.
If you didn't have the code of the external indicator you want to use in your code iCustom is the only way to use the indicator in your code because iCustom works with the already compiled indicator (.exe4 format).