I will write an advisor free of charge - page 41

 
Anton Kedo:
the topic seems to have been abandoned.
No, why... they read it sometimes, it's just that requests like "I have a cool idea, like a grail" are rarely followed. Especially without a ToR.
 
Good afternoon. I have an interesting idea how to improve ilean (martingale) to prevent plummeting. The essence is very long to describe here, who will try to explain the essence of the idea in Skype.
 
Evgeniu Semenuta:
Good afternoon. I have an interesting idea how to modify the illan (martingale) to prevent plummeting. The essence of a very long description here, who will try to explain the essence of the idea in Skype.
Read the previous post!
 

Okay. Let me try to describe it. Let's say the price drops, and the illan has already started to buy. Naturally, he adds positions to buy increasing the lot and so on, until the price rolls back or until the deposit is sold out. I would like to try the following variant: when the price reaches 10 knees, the owl places 2 pending orders at once after 15 points (total LOS of previous orders placed divided by 2).

1 order sets only stop loss on the level of profit of the previous 10 knees

2) Stop Loss order on the profit level of the previous 10 bends, profit 15

Then we have two possible outcomes: the price sets a stop loss, comes back, closes the grid of 10 bends and we are out of two losing orders. Or the market goes down persistently, the 2nd order closes on the profit and puts another one or two negative orders from the net of 10 bends after about 10 points and closes one or two negative ones. The second pending order pulls a stop loss to Breakeven and waits until the end.

Somehow. It is difficult to explain in words (. If you are interested, I will explain the idea in details on the chart in Skype.

 
Evgeniu Semenuta:

Okay. Let me try to describe it. Let's say the price drops, and the illan has already started to buy. Naturally, he adds positions to buy increasing the lot and so on, until the price rolls back or until the deposit is sold out. I would like to try the following variant: when the price reaches 10 knees, the owl immediately places 2 pending orders (total LOS of previous orders placed divided by 2) in 15 points.

1 order sets only stop loss on the level of profit of the previous 10 knees

2) Stop Loss order on the profit level of the previous 10 bends, profit 15

Then we have two possible outcomes: the price sets a stop loss, comes back, closes the grid of 10 bends and we are out of two losing orders. Or the market goes down persistently, the 2nd order closes on the profit and puts another one or two negative orders from the net of 10 bends after about 10 points and closes one or two negative ones. The second pending order pulls a stop loss to Breakeven and waits until the end.

Somehow. It is difficult to explain in words (. If you are interested, I will explain the idea in details on the chart in Skype.

The usual idea that leads to the inevitable plum! Details are no longer interesting!
 

Good afternoon, is the option to rework the original EA considered in this thread ? If so, below is the description :

I have an EA that needs to be refined ( it does not close trades by itself, when trading is allowed and two parameters are not fulfilled : indication of closing area and indication of partial closing volume size ) )ToR Description :

Time frame: any


Used symbols:

Bollinger bands : period 20

outliers 2

applied to close



ADX: period 14

applied to close

set the level at 25



Buy signal: during a flat (when ADX level is below 25), wait for the price to close at the bottom Bollinger Band (parameter o defines open point of order, distance from middle Bollinger Band to bottom Bollinger Band is defined as 100 %, 0 % is at bottom Bollinger Band, 10 % is higher, etc.), then wait for the price increase on the confirmation candle close. We open buy. Stop Loss is set in pips in the settings. order closing depends on the options in the EA, options parameters will be explained later. the order is closed with the parameter n when it touches the middle band of bollinger (parameter n is set in percent, defines what part of volume is closed, in lots this value is rounded down, 0% means that nothing is closed) . Stop Loss is set at the opening price of the order, then the order is fully closed with the parameter f (the distance from the middle bollinger band to the upper band is 100 per cent, the parameter f defined as a percentage defines the point where the order will be closed if the price reaches it, 0 per cent is the point at the upper bollinger band 10 per cent is lower, etc.) )/

Sell order: during a flat (when ADX is below 25), wait for the price to close at the top Bollinger Band (o specifies the entry point of the order, the distance from the average Bollinger Band to the top band is 100 per cent, 0 per cent is at the top Bollinger Band, 10 per cent is below etc.), then wait for the confirmation candle to close moving towards the lower price. We open the sale. Stop Loss is set in pips in the settings .order closing depends on the options in your EA, options parameters will be explained later .The order is closed with the parameter n when it touches the middle bollinger band. (parameter n is set in percents, it defines what part of volume is being closed, in lots this value is rounded down, it means that nothing is being closed).Stop Loss is set at opening price, further the order is being closed completely with parameter f. (distance from middle bollinger band to bottom band is considered as 100 %, f parameter defined as a percentage defines the point where the order will be closed if the price reaches it, 0 % point at the bottom bollinger band, 10 % higher, etc.)



Options :

Stop Losses can be set in Expert Advisor options or none at all. There are two types of Stop Losses: regular Stop Loss which is given in pips and Stop Loss depending on expected profit, i.e. when an order is opened from the price of the order to the opposite Bollinger Bands (upper or lower) the distance in pips is calculated. In the options, coefficient S (from 0 to 1) is set, which is multiplied by the potential profit. This value is Stop Loss, i.e. if the coefficient is 0.5, then the Stop Loss will be equal to half of the potential profit. )

The programmer who wrote this EA is primarily interested in writing any advisor based on bollinger lines and further modification is not planned. In the attachment I see statistics of strategy on history, on which advisor is based and some properties of half a week of advisor running on VPS (three terms with different manimanagement are running). Below is the code:

#property copyright "Copyright 2015, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
//--- input parameters
input int      BBPeriod=20;
input double   BBdeviation=2.0;
input int      ADX=14;
input double   AdxLevel=25;
input double      SL=2000;
input double      TP=0;
input int      Obuy=5;
input int      Osell=5;
input double   Lot=0.1;
input bool     CloseMiddle=true;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
bool buyOpen=false;
bool sellOpen=false;
double _Obuy;
double _OSell;
int TryShots= 3;
int Slippage=50;                         // Slippage
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int OnInit()
  {
   _Obuy=Obuy/100;
   _OSell=Osell/100;

   if(!IsTradeAllowed())
     {
      string message="You must allow trading!";
      Print(message);
      Comment(message);
      return INIT_FAILED;
     }

   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---

  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   static datetime prevTime;
   datetime currentTime=iTime(Symbol(),0,0);
   if(prevTime==currentTime)
     {
      return;
     }
   else
     {
      prevTime=currentTime;
     }

   double adx=iADX(NULL,0,ADX,PRICE_CLOSE,0,2);

   if(adx<AdxLevel)
     {
      double bbMain1=iBands(NULL,0,BBPeriod,BBdeviation,0,PRICE_CLOSE,0,2);
      double close=iClose(NULL,0,2);
      if(!buyOpen)
        {
         double bbDown1=iBands(NULL,0,BBPeriod,BBdeviation,0,PRICE_CLOSE,2,2);
         BuyPosition(bbDown1,bbMain1,close);
        }
      else
        {
         double currentClose=iClose(NULL,0,0);
         double currentBB=iBands(NULL,0,BBPeriod,BBdeviation,0,PRICE_CLOSE,0,0);
         if(CloseMiddle && currentClose>currentBB)
           {
            CloseOpenPos(OP_BUY);
            buyOpen=false;
           }
        }

      if(!sellOpen)
        {
         double bbUp1=iBands(NULL,0,BBPeriod,BBdeviation,0,PRICE_CLOSE,1,2);
         SellPosition(bbUp1,bbMain1,close);
        }
      else
        {
         double currentClose=iClose(NULL,0,0);
         double currentBB=iBands(NULL,0,BBPeriod,BBdeviation,0,PRICE_CLOSE,0,0);
         if(CloseMiddle && currentClose<currentBB)
           {
            CloseOpenPos(OP_SELL);
            sellOpen=false;
           }
        }
     }

  }
//+------------------------------------------------------------------+

void BuyPosition(double bbDown,double bbMain,double close)
  {
   double dif=bbMain-bbDown;
   double proc=dif *_Obuy;
   double DownProc=bbDown+proc;

   if(close<DownProc)
     {
      double openCurrent=iOpen(NULL,0,1);
      double closeCurrent=iClose(NULL,0,1);
      if(closeCurrent>openCurrent)
        {

         for(int it=0; it<TryShots; it++)
           {
            ResetLastError();
            RefreshRates();
            double sl,tp;
            if(SL!=0)
               sl=NormalizeDouble(Bid-SL*Point,Digits);
            if(TP!=0)
               tp=NormalizeDouble(Bid+TP*Point,Digits);
            Print(Ask+" sl"+sl+" tp"+tp);
            if(!OrderSend(Symbol(),OP_BUY,Lot,NormalizeDouble(Ask,Digits),Slippage,sl,tp))
              {
               if(it>=TryShots) { Print("Failed OP_BUY !"); break; }
               int err=GetLastError();
               if(err==4 || err==6 || err==8 || err==128 || err==137 || err==141 || err==146) Sleep(1000*it);
               else { Print("Failed OP_BUY !"); break; }
              }
            else
              {
               buyOpen=true;
               break;
              }

           }
        }
     }
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void SellPosition(double bbUp,double bbMain,double close)
  {
   double dif=bbUp-bbMain;
   double proc=dif*_OSell;
   double UpProc=bbUp-proc;

   if(close>UpProc)
     {
      double openCurrent=iOpen(NULL,0,1);
      double closeCurrent=iClose(NULL,0,1);
      if(closeCurrent<openCurrent)
        {
         for(int it=0; it<TryShots; it++)
           {
            ResetLastError();
            RefreshRates();
            double sl,tp;
            if(SL!=0)
               sl=NormalizeDouble(Ask+SL*Point,Digits);
            if(TP!=0)
               tp=NormalizeDouble(Ask-TP*Point,Digits);
            Print(Bid+" sl"+sl+" tp"+tp);
            if(!OrderSend(Symbol(),OP_SELL,Lot,NormalizeDouble(Bid,Digits),Slippage,sl,tp))
              {
               if(it>=TryShots) { Print("Failed OP_SELL !"); break; }
               int err=GetLastError();
               if(err==4 || err==6 || err==8 || err==128 || err==137 || err==141 || err==146) Sleep(1000*it);
               else { Print("Failed OP_SELL !"); break; }
              }
            else
              {
               sellOpen=true;
               break;
              }
           }
        }
     }
  }
//+------------------------------------------------------------------+
//| Close open position                                              |
//+------------------------------------------------------------------+
void CloseOpenPos(int or_tp)
  {
   int i,err,k=OrdersTotal();
//---
   for(i=k-1; i>=0; i--)
     {
      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
        {
         if(OrderSymbol()==Symbol())
           {
            if(or_tp==OrderType())
              {
               for(int it=0; it<TryShots; it++)
                 {
                  ResetLastError();
                  RefreshRates();
                  double _price=Ask; if(or_tp==OP_BUY) _price=Bid;
                  //---
                  if(!OrderClose(OrderTicket(),OrderLots(),_price,Slippage))
                    {
                     if(it>=TryShots) { Print("Failed to close the order ",OrderTicket(),"!"); break; }
                     err=GetLastError();
                     if(err==4 || err==6 || err==8 || err==128 || err==137 || err==141 || err==146) Sleep(1000*100);
                     else { Print("Failed to close the order ",OrderTicket(),"!"); break; }
                    }
                  else break;

                 }
              }
           }
        }
     }
  }

//+------------------------------------------------------------------+

I am adding more screenshots from terminal, running on VPS: screenshots "1" and "2" examples when advisor does not open dealsby itself

Screenshot "Lock", the Expert Advisor did not close the Buy position by itself and opened a Sell position due to the appearing Sell conditions.
Screenshot "order received", in this case the order was opened correctly.
Files:
Pictures.zip  775 kb
a2ji9v3g8.zip  14 kb
Statement.zip  23 kb
 

Who has a script that closes all orders on total profit - please send it to us.

I would appreciate it.

 

I have been working on this for a long time and I've been working on this for a long time now. I've been working on this for a long time now and I've been working on this for a long time now.

In fact, I could even try to write one myself if I understand what variables it uses to display "eye", blue and red markers!

 
baikot:

I have been working on this for a long time and I've been working on this for a long time now. I've been working on this for a long time now and I've been working on this for a long time now.

In fact, I could even try to write one myself if I understand what variables it uses to display "eye", blue and red markers on the screen!

Where is the indicator itself?
 
Victor Nikolaev:
Where is the indicator itself?
You don't need to, though. You will only find the decompile and get into the bathhouse.
Reason: