Ok so you have 2x OnInit() and
#property indicator_buffers 2 #property indicator_chart_window
This is for Indicators not for Experts and Indicators can not trade so what is your program suppose to be ?
You are mixing Indicator code with Expert Advisor code.Ok so you have 2x OnInit() and
This is for Indicators not for Experts and Indicators can not trade so what is your program suppose to be ?
You are mixing Indicator code with Expert Advisor code.Am actually trying to include an external indicator to work simultaneously with my EA.
These codes are for the EA and I' ve included the code to instruct my Advisor to Read signals from my indicator.
The attached file "Indicator Signal" is the Indicator loaded onto a chart.The diamond arrow winding 116 is where I need trade execution with predefined SL and TP.
As per indicator Buy entry color is MediumBlue and Sell Entry color is Crimson.
You can not incorporate indicators like that into an Expert Advisor, you have to either use iCustom or hard code the calculation into the EA.
- www.mql5.com
You can not incorporate indicators like that you have to use iCustom or hard code the calculation into the EA.
I really appreciate your prompt and educative guidance.
I could understand the mistakes in my codes.This will certainly help me in the future.
All the errors were resolved in my code with your help and guidance.
Keep up the good work.
May God bless You.
Live Long and Prosper.
Thanks and Regards.
Don't try to do that. There are no buffers, no IndicatorCounted() or prev_calculated. No way to know if older bars have changed or been added (history update.)
Just get the value(s) of the indicator(s) into EA/indicator (using iCustom) and do what you want with it.
You should encapsulate your iCustom calls to make your code self-documenting.
Detailed
explanation of iCustom - MQL4 programming forum #33
2017.05.23
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Greetings To All
Lately I've been trying to create an Expert Advisor for myself. However while coding for the same; I've been receiving errors which i have failed to understand and rectify as i lack expertise in the language .I've attached the screenshots for the same below.The code has all been attached externally as it is pretty lengthy; so feel free to make the required changes and revert.Although I understand it may not be accurate so if any other errors are noticed please inform me.If someone could provide some tips or be willing to aid in rectification of the code ; It'd be of great help.
Error received : Errors.png
Error 2 : Errors 2.png
Error 3 :Errors 3.png
Thanks!