So I read in basic terms that an Indicator shows you trends, MA's, etc. but that Indicator scripts do not (or maybe is was cannot) do trade.buy and trade.sell functions . You have to write an EA to do trades.
My questions is really this:
If I write an EA to do trades, I'd want to code in some indicators/triggers for the trades to kick in or not kick in. Should I start with one of the Indicator scripts and modify it to do trades or should I write the script as an EA script and copy the indicator code to get the indicators working in the EA script?
I'm just a little confused about the structure of the Indicator scripts vs the EA scripts.
Thank you...
Personally, I like to do this: to test an idea (to visually evaluate the idea) - I am writing an indicator. If the idea is of interest - I write an adviser on this indicator.
In general, the main thing is first the idea, then the realization of the idea.
Can you drive in the ocean? Can you boat down the highway?
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
I found a good explanation here: https://www.mql5.com/en/articles/496
This is a good explanation if you're new to MT5 programming like I am.
- www.mql5.com
So I read in basic terms that an Indicator shows you trends, MA's, etc. but that Indicator scripts do not (or maybe is was cannot) do trade.buy and trade.sell functions. You have to write an EA to do trades.
My questions is really this:
If I write an EA to do trades, I'd want to code in some indicators/triggers for the trades to kick in or not kick in. Should I start with one of the Indicator scripts and modify it to do trades or should I write the script as an EA script and copy the indicator code to get the indicators working in the EA script?
I'm just a little confused about the structure of the Indicator scripts vs the EA scripts.
Thank you...
Can you drive in the ocean? Can you boat down the highway?
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
I have been using this resource for a few months and keep seeing these sarcastic, arrogant, unhelpful or rude comments from William Roeder. Is there really a need for it? It really makes this group seem unfriendly.
I don't know what drives it but this is a place for learning and it would be much better if it was a friendly place for learning - where questions from people who aren't as experienced weren't looked down on.
I think this is a valid question as I am making a multitimeframe program and don't know which parts are best in the indicator and which in the EA. It seems that indicators from a different timeframe don't show up on the EA but I can find very little information about how to make multi timeframe programs.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
So I read in basic terms that an Indicator shows you trends, MA's, etc. but that Indicator scripts do not (or maybe is was cannot) do trade.buy and trade.sell functions. You have to write an EA to do trades.
My questions is really this:
If I write an EA to do trades, I'd want to code in some indicators/triggers for the trades to kick in or not kick in. Should I start with one of the Indicator scripts and modify it to do trades or should I write the script as an EA script and copy the indicator code to get the indicators working in the EA script?
I'm just a little confused about the structure of the Indicator scripts vs the EA scripts.
Thank you...