Experts: Ilan iMA

 

Ilan iMA:

Ilan based on indicator iMA (Moving Average, MA)

Ilan iMA

Author: Vladimir Karputov

 

Good afternoon, Vladimir. Is it possible to implement the function of enabling only Buy or Sell in this Expert Advisor? I want to try to run the Expert Advisor on two charts, one for Buy and the other for Sell. Will it work if I change one of the selected parameters true to false?


 if(ma[0]<ma[1] && ma[1]<ma[2] && ma[2]<ma[3]) // trend down
        {
         if(m_symbol.Bid()>ma[0])
            m_need_open_sell=true;
        }
      else if(ma[0]>ma[1] && ma[1]>ma[2] && ma[2]>ma[3]) // trend up
        {
         if(m_symbol.Ask()<ma[0])
            m_need_open_buy=true;
        }
 
Rinat Gizatullin #:

Good afternoon, Vladimir. Is it possible to implement the function of enabling only Buy or Sell in this Expert Advisor? I want to try to run the Expert Advisor on two charts, one for Buy and the other for Sell. Will it work if I change one of the selected parameters true to false?


It is rough, but it will work. Of course, it is better to add an input parameter.
 

Vladimir Karputov #:
Это грубо, но сработает. Конечно лучше добавить входной параметр. 

Can you modify the EA on a financial basis to enable only buying or only selling in the settings? For example, as in this EA of yours https://www.mql5.com/en/code/16728

Opening and Сlosing on time
Opening and Сlosing on time
  • www.mql5.com
Открытие и закрытие в определённое время. Открытие происходит заданным объёмом и на заданном символе. Есть выбор типа позиции: "Buy" или "Sell".
 
Rinat Gizatullin #:

Can you modify the EA on a financial basis to enable only buying or only selling in the settings? For example, as in this EA of yours https://www.mql5.com/en/code/16728

I have run the tests, it seems to work, put it on a demo account and see what happens.

 
we set stop loss 100, take profit 100 and that's our happiness.
 
Could you add a function to close a series of orders with a common take profit or by deposit? But each order is closed separately. As a result, averaging does not work.
Files:
 

the pictures of the sell entry in the description do not match this condition:

   if(count_buys+count_sells==0) // no open positions
     {
      m_lot=InpStartLots;
      if(ma[0]<ma[1] && ma[1]<ma[2] && ma[2]<ma[3]) // trend down
        {
         if(m_symbol.Bid()>ma[0])
            m_need_open_sell=true;
        }
      else if(ma[0]>ma[1] && ma[1]>ma[2] && ma[2]>ma[3]) // trend up
        {
         if(m_symbol.Ask()<ma[0])
            m_need_open_buy=true;
        }
     } 
 

Very nice EA, well done.

Do you have the same for a netting account?

Thank you