Can you please, help me?

 

So, I've been using expert advisors since a couple weeks ago, and I realized something strange about it. I can set the parameters of the experts to almost always buy and sell at the wrong time, but I can't set them to almost always buy and sell at the right time. So, I downloaded an open source expert and tried to change the code so it would buy instead of sell and sell instead of buy, buy it didn't even budge. And when it did, the results were all f*cked up. Sometimes it would only sell and never buy, then it would only sell once, then nothing happened. 

 The expert I'm trying to change is: https://www.mql5.com/en/code/1554

 Could someone tell me what I'm doing wrong or change the code for me? Pretty please?

Difference of Two Moving Averages
Difference of Two Moving Averages
  • votes: 33
  • 2013.02.28
  • Winston
  • www.mql5.com
An Expert Advisor based on the difference of two moving averages.
 
Mantius:
...

 Could someone tell me what I'm doing wrong or change the code for me? Pretty please?

We have no idea what you have done. Where is YOUR code ?
 
Alain Verleyen:
We have no idea what you have done. Where is YOUR code ?

I have nearly no knowledge about programming, all I did was:

 

Change this(1):

  req.type=ORDER_TYPE_SELL;

   req.action=TRADE_ACTION_DEAL;

   req.price=SymbolInfoDouble(_Symbol,SYMBOL_BID); 

 

into this:

   req.type=ORDER_TYPE_BUY;

   req.action=TRADE_ACTION_DEAL;

   req.price=SymbolInfoDouble(_Symbol,SYMBOL_ASK); 

 

and vice versa.

 

Also tried changing this(2):

    if(PositionSelect(_Symbol) && trade==1 && PositionGetInteger(POSITION_TYPE)==POSITION_TYPE_SELL) BUY(PositionGetDouble(POSITION_VOLUME));

   if(PositionSelect(_Symbol) && trade==-1 && PositionGetInteger(POSITION_TYPE)==POSITION_TYPE_BUY) SELL(PositionGetDouble(POSITION_VOLUME));

 

into this:

   if(PositionSelect(_Symbol) && trade==1 && PositionGetInteger(POSITION_TYPE)==POSITION_TYPE_BUY) SELL(PositionGetDouble(POSITION_VOLUME));

   if(PositionSelect(_Symbol) && trade==-1 && PositionGetInteger(POSITION_TYPE)==POSITION_TYPE_SELL) BUY(PositionGetDouble(POSITION_VOLUME));

 

also tried this(3):

   if(PositionsTotal()==0 && trade==1) BUY(lots);

   if(PositionsTotal()==0 && trade==-1) SELL(lots); 

 

into this:

   if(PositionsTotal()==0 && trade==1) SELL(lots);

   if(PositionsTotal()==0 && trade==-1) BUY(lots); 

 

I tried changing only one, two or three. Changing one and two, one and three, two and three, and one and two and three.

 
Mantius: I have nearly no knowledge about programming,
  1. Don't paste code
    Play video
    Please edit your post.
    For large amounts of code, attach it

  2. Then there is no common language for us to communicate. learn to code it, or pay (Freelance) someone to code it. We're not going to code it for you. We are willing to help you when you post your attempt (using SRC) and the nature of your problem.
Reason: