Fully convinced of the convenience to use built in libraries to create an Expert Advisor reducing errors and bugs, I want to understand how set an entry price different from the market price. I have read the article “MQL5 Wizard How to Teach an EA to Open Pending Orders at Any Price” by Karputov in which the author use the variable “price.level” to set a customized entry price.
But studying the built in Signals, I believe I there could be a simpler way.
I found that in the “SignalMA.mqh” you use another method: in the pattern2 there is the variable “m_base_price” set by the program at “m_base_price=m_symbol.NormalizePrice(MA(idx));”.
So I try to create a EA with the wizard using that signal (really, to be sure that only the pattern 2 is used, I create another signal – called “SignalMA_REV.mqh” – setting to 0 the weight of the other pattern) BUT it doesn’t work!
During the test I found that the EA use the market price instead of the MA price!
Please, could you explain why does it not work? Or where do I make some mistake?
Thank you in advance, best regards.
My impression is that the EA wizard is a great idea, not fully developed and supported. Unfortunately I guess I have to start to code in the traditional way.
ciao
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Fully convinced of the convenience to use built in libraries to create an Expert Advisor reducing errors and bugs, I want to understand how set an entry price different from the market price. I have read the article “MQL5 Wizard How to Teach an EA to Open Pending Orders at Any Price” by Karputov in which the author use the variable “price.level” to set a customized entry price.
But studying the built in Signals, I believe I there could be a simpler way.
I found that in the “SignalMA.mqh” you use another method: in the pattern2 there is the variable “m_base_price” set by the program at “m_base_price=m_symbol.NormalizePrice(MA(idx));”.
So I try to create a EA with the wizard using that signal (really, to be sure that only the pattern 2 is used, I create another signal – called “SignalMA_REV.mqh” – setting to 0 the weight of the other pattern) BUT it doesn’t work!
During the test I found that the EA use the market price instead of the MA price!
Please, could you explain why does it not work? Or where do I make some mistake?
Thank you in advance, best regards.