Trading by Moving Average. Checking for sufficiency of funds.
Author of the idea is Konstantin Grand, author of the MQL5 code is barabashkakvn.  Â
Operation Principle:
Performance result on EURUSD, M30 from 2016.05.08 to 2016.12.28:
Â
Also, before each operation, we should check if we have sufficient funds:
        //— check volume before OrderSend to avoid “not enough money” error (CTrade)
        double chek_volime_lot=m_trade.CheckVolume(m_symbol.Name(),1.0,m_symbol.Bid(),ORDER_TYPE_SELL);
…
        //— check volume before OrderSend to avoid “not enough money” error (CTrade)
        double chek_volime_lot=m_trade.CheckVolume(m_symbol.Name(),1.0,m_symbol.Ask(),ORDER_TYPE_BUY);
        double chek_volime_lot=m_trade.CheckVolume(m_symbol.Name(),1.0,m_symbol.Bid(),ORDER_TYPE_SELL);
…
        //— check volume before OrderSend to avoid “not enough money” error (CTrade)
        double chek_volime_lot=m_trade.CheckVolume(m_symbol.Name(),1.0,m_symbol.Ask(),ORDER_TYPE_BUY);
This protection allows avoiding the “not enough money” error.
Â