Adviser Ivan - the best of ilan - page 7

 

And immediately a test:

Ivan 1.004 USDJPY, M15, period 2016.01.01 to 2017.02.13

Ivan 1.004 USDJPY, M15, period 2016.01.01 to 2017.02.13

 
Vladimir Karputov:

I'll make it like this for now:Ivan version "1.003":

  • Logic to set Stop Loss level:
    • there is a minimum indentation - 50 old mode points.
    • Stopp Loss takes the value of iMA(36) MODE_SMMA on zero bar (the averaging period is written in the input parameters).
    • if the Stop Loss level is closer to the current price than the minimum slope, the position opening will not take place
  • Virtual Stop Loss has been replaced by trailing positions.

The work is boiling - good!

However, I can't view the work yet - I don't have a forex account - only from the exchange, and the EA does not work there.

 
-Aleks-:

The work is boiling - good!

However, I can't see the work yet - I don't have a forex account - only from the exchange, and the advisor doesn't work there.

And I have the opposite: no connection to the exchange at the moment. And it will be like in that song:

You're a sailor, I'm a sailor.

You're a fisherwoman, I'm a fisherman.

You're on land, I'm at sea.

We'll never meet.

Added:

Trading on the exchange is netting and my advisor is only for hedging (as reported by the error printout when trying to connect to an exchange account:

2017.02.26 14:04:05.291 2016.04.22 00:00:00   Hedging only!

). So the exchange is flying by with a whistle of plywood on Paris.

 
Vladimir Karputov:

I have the opposite: there is no connection in the exchange right now. And it will be like in that song:

You're a sailor, I'm a sailor.

You're a fisherman I'm a fisherman

You're on land I'm at sea

We'll never meet.

Added:

Trading on the exchange is netting and my advisor is only for hedging (as reported by the error printout when trying to connect to an exchange account:

2017.02.26 14:04:05.291 2016.04.22 00:00:00   Hedging only!

). So the exchange flies by with a whistle of plywood on Paris.

Yes, I understand, I just have Forex under 4 - maybe later I will open on demo - I will leave ideas if it will be interesting.

 
Teach me someone with a pro how to use the mt5 tester, I can't take much time in voice mode.
 
Vitaly Muzichenko:
Teach me someone with a pro how to use the mt5 tester, I can't take much time in voice mode.
Call...
 
Vladimir Karputov:

No, I don't think that's a good approach: there are a lot of people, everyone likes different pairs and different timeframes. I'd rather prescribe it directly in the input parameters:


Ivan version "1.004":

  • entered variables
    • "Minimum distance from the price to stop loss (in pips)" - the minimum distance between the price and the Stop Loss level - if this distance is less, no position will be opened
    • "Trailing Step(in pips)- the step for trailing
  • protection at position opening:
    • for BUY - if one of the already opened BUY positions has an opening price lower than the current price - the BUY position will not be opened
    • for SELL position - if one of SELL position has an opening price higher than the current price - then SELL position will not be opened
Yes, that's much better. I optimized with your recommendations, I got as much as 50% for 2 weeks optimization, but when I ran the test for a month, I lost the same amount ))
 
-Aleks-:

The work is boiling - good!

However, I can't look at the work yet - I don't have a Forex account - only from the stock exchange, and the advisor doesn't work there.

It's just awful. To open a demo on MetaQuotes-Demo server, it takes a minute and a half ))
 

Ivan version "1.005":

  • Fixed "FindPosition" function to find the minimum/maximum position of a certain type (price search):
  •                if(mode==MODE_LOW)
                     {
                      if(m_position.PriceOpen()<price)
                         price=m_position.PriceOpen();
                     }
                  }
       if(price==DBL_MIN || price==DBL_MAX)
          price=0;

       return(price);
      }
    now if no position of a given type was specified, a price of "0" will be returned - previously it was possible to return a DBL_MIN or DBL_MAX value.
  • Fixed the function to open a Buy position. An unfavourable variant was possible earlier - when several consecutive Buy positions were opened and each consecutive one was opened at a worse price than the previous one - in case of hitting the trend reversal it caused appreciable losses:
    bad Buy's

    this has now been fixed (yes, yes, yes - the error was in the condition sign - previously it was a "<" sign:
  •       return;
         }
    //--- the position of BUY can't be open below the lowest
       double price_open_low=FindPosition(POSITION_TYPE_BUY,MODE_LOW);
       if(price_open_low!=0)
          if(price_open_low> m_symbol.Ask())
             return;

       sl=m_symbol.NormalizePrice(sl);
       double tp=0.0;
  • Added:

    Ivan 1.005

Files:
Ivan.mq5  45 kb
 

Ivan version "1.006":

  • Profit protection was introduced:
    • new input parameter"InpCoefProtectionProfit" - calculated as m_account.Equity()/m_account.Balance() (Funds divided by Balance).
    • When Equity exceeds the Balance by a factor of "InpCoefProtectionProfit" we close all positions - thus protecting the profit:
      //--- we work only at the time of the birth of new bar
         static datetime dtPrevBars=0;
      //--- protection of profit
         if(m_account.Equity()/m_account.Balance()>InpCoefProtectionProfit)
            bCloseAll=true;

      //--- trailing stop (at every tick)
         if(!RefreshRates())
            return;
         TrailingStop();
Files:
Ivan.mq5  46 kb
Reason: