Download MetaTrader 5

EA by WIZARD- How to set an entry price for a pending order ???

To add comments, please log in or register
grissone
13
grissone 2014.05.07 15:34 

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.

Files:
Matteo Pedroni
210
Matteo Pedroni 2014.05.12 10:55  
grissone:

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.

I share your ideas and I am digging in the EA wizard too. Unfortunately I am facing many strange behaviors buiding test EA using the standard library components. Little documentation does not help and I have not found much help on this forum as in other forum too.


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

To add comments, please log in or register