Philippe Pauleau: I am trying to use iCustom with the simple call form of OnCalculate indicator.
Please show your code where you are using the iCustom() call and wanting the default value for the applied price.
Documentation on MQL5: Technical Indicators / iCustom
- www.mql5.com
iCustom - Technical Indicators - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
Fernando Carreiro #:
Please show your code where you are using the iCustom() call and wanting the default value for the applied price.
Please show your code where you are using the iCustom() call and wanting the default value for the applied price.
Sure.
Inside EA:
HandleBands = iCustom(NULL,_TimeFrame,"Examples\BB.ex5", _BandsPeriod,0,_BandsDeviation);
and I've modified the included Examples\BB.mq5 example indicator adding
#property indicator_applied_price PRICE_LOW
The UI interface is correctly using this property as default.
But iCustom function does not take it into account and still apply to PRICE_CLOSE which is the default
Strange
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
HI
I am trying to use iCustom with the simple call form of OnCalculate indicator.
Using this form, we can define in the indicator the #property indicator_applied_price in order to apply price to something other than PRICE_CLOSE
Help page is saying : "If the first call form is used in the indicator, then at the custom indicator start you can additionally indicate data for calculation in its "Parameters" tab. If the "Apply to" parameter is not selected explicitly, the default calculation is based on the values of "Close" prices."
#property indicator_applied_price PRICE_CLOSE works when attaching the indicator manualy to the charts using Terminal UI
but it is not taken into account when using iCustom inside EA code.
Do you know why ?
Thank you
Regards