Discussion of article "Developing a trading Expert Advisor from scratch (Part 23): New order system (VI)"

 

New article Developing a trading Expert Advisor from scratch (Part 23): New order system (VI) has been published:

We will make the order system more flexible. Here we will consider changes to the code that will make it more flexible, which will allow us to change position stop levels much faster.

Please watch the video below to have a clearer idea of what's going on with the changes made. You will see that now we only need a few more details to make the EA fully complete in terms of the order system.

Author: Daniel Jose

 

Hi Jose,

how can i use this EA on US30 index or S&P500? When i make Shift an left Click, comes an error 10015? How can i fix that?

Best regards
Florian

 
Ovm6 # :

Hi Jose,

how can i use this EA on US30 index or S&P500? When i make Shift an left Click, comes an error 10015 ? How can i fix that?

Best regards
Florian

I don't know exactly what could be going on. Since this error you are reporting would indicate a failure in the price calculation. But all the calculation is performed in the DispatchMessage procedure in the C_IndicatorTradeView class. This calculation takes into account the data provided by the server, coming from the C_Terminal class.

Perhaps what could be happening is that you are using the wrong contract. I don't know if these assets you mention have an expiration date. If this is the case, you will have to add the correct contract search rules in the CurrentSymbol procedure within the C_Terminal class. Thus, the application will do all the calculations and correctly send the order to the trading server.

You can use newer code. Since this article is completely obsolete. See my most recent articles, as the codes are much better and simpler to understand as I'm focusing much more on explaining them. This makes it simple for you to adapt the system to what you need.