
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
in the iMA command you have the ability to define a custom enum price. That is what I'm trying to use...
No you can't just define a "custom enum price", where did you see that ?
You can :
1° Build a custom indicator to calculate your custom price, then get an handle to this indicator and use it with iMA.
2° Don't use iMA at all and create your own custom indicator to calculate an MA of your custom price.
exactly what I'm trying to do : create a custom indicator to get a handle to be used with existing functions such as iMA or iRSI.
The thing is if this indicator would be using iMA or other functions returning a handle that would be fine. but in my case I simply want to
create an indicator that calculate my custom price (Close + Spread/2). and I don't manage to do it...
-
Search for it,
-
Beg at
Will code your trading
systems for free - Free Expert Advisors - Trading Systems -
MQL5 programming forum,
or Coding help -
MQL4 and MetaTrader 4 - MQL4 programming forum,
or Need help with
coding - General - MQL5 programming forum,
or Free MQL4 To MQL5
Converter - General - MQL5 programming forum,
or Requests & Ideas
(MQL5 only!),
or I will code & automate your strategy for free - Options Trading
Strategies - General - MQL5 programming forum.
-
learn to code it. If you don't learn MQL4/5, there is no common language
for us to communicate. If we tell you what you need, you can't code it. If we
give you the code, you don't know how to integrate it into yours.
-
or pay
(Freelance) someone to code it.
We're not going to code it for you (although it could happen if you are lucky or the problem is interesting.) We are willing to help you when you post your attempt (using CODE button) and state the nature of your problem.No free help
urgent help.
for instance when instead of a PRICE_CLOSE I use a RSI, this is fairly direct since the iRSI function returns a handle...
ie : CUSTOM_HANDLE = iRSI(....) then you can use CUSTOM_HANDLE in the original iMA function and that works. But in my case
I can't do CUSTOM_HANDLE = iClose (NULL,0,0) + iSpread (NULL,0,0)....
Alain,
thanks for naming the rules. First, I don't want to have code generated by someone else, I have lots of PRT EA to redevelop using MT5.
Maybe, the global topic is of interest, I don't know what you think. Generally speaking, MT5 uses Bid price to determine the Close Price,
where as PRT uses Middle Price (Bid + Spread/2). That is why every people looking to "migrate" PRT EAs to MT5 EAs will have to deal with that.
In order to be more efficient and reuse all MT5 built in functions (iMA, iRSI,etc....) I think it is better to create a custom indicator that calculates
the MIDDLE PRICE.
Having said that, I've searched a lot and I'm blocked at compilation time with a array out of range message.
Here is the code :
No you can't.
Write the indicator. Then you can use iMA(indicatorHandle)
Or create an indicator with a price buffer, and then implement iMAOnArray on a second buffer.
Thanks for your answer. As I want to take advantage of the built in functions of MT5, I will go for your first proposition ie write an indicator that computes
the price and then apply iMA to it.
I created an indicator in a file called prix : the file compiles well and also shows the right price on a graph.
Then I have my main code file that is supposed to compute the MA of this indicator.
The iMA calculation doesn't take into account the prices that I put in the prixBuffer.
Even if I put zero, the MA is still the same and doesn't change.
Both files source codes are below :
Do you have an idea why this happens?