Discussion of article "Universal Expert Advisor: the Event Model and Trading Strategy Prototype (Part 2)" - page 4
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
At the very least, analyse the price. Maybe you don't need to enter at all.
Yes, there is such a mechanism. And where should it be built in, if not in the class of trade orders? And how to formalise such a mechanism, what sharp movement should be considered critical?
Well, that's the question! That is why it is not built into the engine.
For one strategy a slip of 20 pips does not matter, and you should enter anyway, while for another strategy a slip of 2 pips breaks all the statistics, and you should not enter worse.
And what should a universal trading engine do for these two strategies? Right, return the requote price and let the trading logic make a decision.
Well, or add a customisation. More precisely, settings for all cases of life )
On build 1241, the code is compiling well, so I tried to run a backtest. It doesn't take any trades.
After digging a bit I found it's due to filling mode. The mode allowed on the broker/symbol I am using is ORDER_FILLING_IOC. Your TradeCustom class set the filling mode by default to ORDER_FILLING_FOK. And I am stick there, how can change this filling mode for the Agent.mq5 EA to take trade ? I could search, it will take me a lot of time.
That's the problem with such tools, very similar to MQL5 wizard EA from Metaquotes, it's almost unusable for anyone who doesn't know all the details of the classes. Once you face an issue which was not provided by the author it becomes a real pain to fix it or modify/add to it. I don't see any real difference between your solution and the one from Metaquotes (wizard).
Anyway, congratulations for the huge work. It is a great programming work.
There are some classes in MetaEditor5 include folder. If some one can give us a deep explain of Expert folder classes, it will be very helpful, because they looks very complicated. People like to write standard EA based on formal base classes and not always re-create wheels.... Anyway, this article helps a lots for not re-create wheels.
I do agree. The problem is when there is a bug in the framework. Before using a framework we should either decide to learn it deeply or to be sure it's well supported by the author.
This is why I want to learn classes in MetaEditor5, they're from "government". ;)
Mr Vasily,
very nice code... and useful to me...
in the mt5 news builds (1952), we got a "message" in the compiler,
//+------------------------------------------------------------------+
expression not boolean NewBarDetector.mqh 87 24
the correct should be this? please confirm
Hi Vasiliy,
Please pardon me for asking a question on your article this far down after you wrote it. I'm only going through the articles properly now in search of alternatives to a framework. Something has struck me as odd, very likely due to my misunderstanding.
With regards to New Tick and New Bar event handlers. You loop through the list of added ticks, then build the event structure, passing it to Init and Support event handlers, e.g. new tick event below:
In one of your examples, e.g. moving average clip below;
This IsTrackEvents function seems to nullify the purpose of NewTickDetect function above! So the Moving Average example above should be able to trade on multiple instruments based on its ability to check multiple symbols as in the NewTickDetect, but the IsTrackEvents allows trading only for the Strategy timeframe & Symbol (symbol being key here). Does this not mean that the NewTickDetect loop is not really required, as the strategy can only trade on its symbol? In effect the new tick detect should only check if the received tick is of the strategy symbol - without looping. Which in effect is similar to having a strategy object for each symbol of interest, which the CStragyList loops over?
I sure hope that I'm making sense, and hope that you can clarify this for me.
I love your work. I have learn't a lot from your articles, so a great many thanks.
Kind regards,
Shep