Discussion of article "An attempt at developing an EA constructor"

 

New article An attempt at developing an EA constructor has been published:

In this article, I offer my set of trading functions in the form of a ready-made EA. This method allows getting multiple trading strategies by simply adding indicators and changing inputs.

The EA created by the constructor immediately features multiple settings, which can be combined to create unique strategies. The version 4.XXX applies the following rules: 

  • the current symbol is used (a symbol of the chart the EA is launched on)
  • Take Profit, Stop Loss and Trailing are set in Points in the inputs. Points — current symbol point size in the quote currency, for example for 'EURSD' 1.00055-1.00045=10 points.

The 'points' can always be seen on the symbol chart by dragging the Crosshair tool:

points

Fig. 1. Points

Author: Vladimir Karputov

 
suhas jetithor #:
Really sir you have done tremendous software it is really useful for new traders. I was very happy when I saw my amount increasing day by day. 
But you have not installed in withdrawals option for customers due to that company is cheating to the poor customer 
I'm also suffering from this with your software I earned $577 but company is not responding my phone, email. So my money stucked in your software.  
So while giving authority to the companies handling software suggest them not to cheat with poor. 
Regards 
Hope for the best 
 
suhas jetithor #:
Really sir you have done tremendous software it is really useful for new traders. I was very happy when I saw my amount increasing day by day. 
But you have not installed in withdrawals option for customers due to that company is cheating to the poor customer 
I'm also suffering from this with your software I earned $577 but company is not responding my phone, email. So my money stucked in your software.  
So while giving authority to the companies handling software suggest them not to cheat with poor. 
Regards 
Hope for the best 

Your money is not stuck in the software, but in your broker's trading account.

You should contact your broker and their regulating authority to help you.

Don't confuse MQL5.com with your broker, they are 2 different things.

 
Dear Vladimir Karputov, Thanks for new ideas on EA coding and sharing ; Happy New Year !
 
thank for shareing,good job
 

Dear Vladimir Karputov, 

A big thank for  your work and your involvement in the community.

There is an error in the code.
In the PendingOrder function, if a custom volume is set for a pending order the ea won't open it because the free_margin_check calculation is bad because check_order_type = -1

   ENUM_ORDER_TYPE check_order_type=-1;
   double check_price=0.0;
   if(SPending[index].volume>0.0)
      check_lot=SPending[index].volume;
   else
     {
      //--- check volume before OrderSend to avoid "not enough money" error (CTrade)
      switch(SPending[index].pending_type)
        {
         case  ORDER_TYPE_BUY:
            check_order_type=ORDER_TYPE_BUY;
            break;
         case ORDER_TYPE_SELL:
            check_order_type=ORDER_TYPE_SELL;
            break;
         case ORDER_TYPE_BUY_LIMIT:
            check_order_type=ORDER_TYPE_BUY;
            break;
         case ORDER_TYPE_SELL_LIMIT:
            check_order_type=ORDER_TYPE_SELL;
            break;
         case ORDER_TYPE_BUY_STOP:
            check_order_type=ORDER_TYPE_BUY;
            break;
         case ORDER_TYPE_SELL_STOP:
            check_order_type=ORDER_TYPE_SELL;
            break;
         default:
            return(false);
            break;
        }
      //--- 
      //...
     }
//...
//--- check volume before OrderSend to avoid "not enough money" error (CTrade)
   double free_margin_check=m_account.FreeMarginCheck(m_symbol.Name(),
                            check_order_type,check_lot,check_price);


The switch should be outside .

Anyway, thank for sharing this tool


 
Mike Pascal Plavonil # :

Dear Vladimir Karputov, 

A big thank for   your work and your involvement in the community.

There is an error in the code.
In the  PendingOrder function, if a custom volume is set for a pending order the ea won't open it because the free_margin_check calculation is bad because  check_order_type = -1


The switch should be outside .

Anyway, thank for sharing this tool


Thank you, changes have been made to the Trading engine 4 code (version "4.012").

 

Hello @Vladimir Karputov -- this is a really good repository of best practices to increase reliability for handling market and pending orders in an EA... It serves as a very good source of inspiration, and I will certainly steal some great ideas you implemented here!

Having said that, I find the codebase a bit too "monolithic" for my personal taste, as I usually prefer a more modular approaches for my own use. Regardless, your EA framework will certainly be very useful to quickly create prototypes for testing new strategy ideas without investing too much time with multiple files, etc... That's really awesome for increasing productivity.

Since about version 2.XXX, I started maintaining two development branches  the normal procedural code and the code in the form of a class (the main objective of the class is implementing multicurrency EAs).

You mention an class-based version of your framework, but I couldn't find it in the attached code -- am I missing something or where can I find that? When testing a new idea, I prefer to operate across multiple symbols simultaneously, so I'd be very grateful if you can point me in the right direction to download those files.

 

Hello Vladimir,


first of all thank You for this great work, which helped me a lot to learn and to understand "a little bit" coding MQL.

Now I've tested a few things and have discovered that when I exclude the buy or sale conditions  lines :1312, 1313 & 1338 the EA  still continue to buy!!

But only buys.

I found this out while testing different formulas, and the EA never did what I wanted :-(

Do you have any idea why this happens ?


Thank You in advance and for sharing this EA



Reason: