[Archive!] Writing an advisor for free - page 55

 
Sanyok, would you like to share the grail?))) ?? )))
 
Vinin:

Nah. 50% profit a month for a year is a good thing, as long as the deposit is at least 1000. I would agree. Once you have done it, you get dividends for a year. Although from experience there will be neither profit nor dividends.

Remember VDev's "meat runs away - keep it" https://www.mql5.com/ru/forum/128443/page2
 
I've already given it out to everyone, you're too late to give it out ))
 
Can't I do it again ?))) just me ?))) very please))
 
Traderr21:
And once again can not ?))) only me?)))) very please)))

I gave you the link, to the branch.

ZS: copy the link and edit the last part

ZZZY: so it will be easier

 
Can you tell me where to find the link? ))))
 
sanyooooook
THIS CODE?

#property copyright ""
#property link      ""
#property show_inputs
//---- input parameters
extern double    Lot=0.01;
double bid_;
extern int PeriodBands=500,
       Deviation=2,
       bands_shift=0;
int Slippage=3;
extern int MAGIK=20101009;
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
{
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
{
   bid_=iClose(NULL,0,0);
   if(Digits==3||Digits==5)
   {
      Slippage=Slippage*10;
   }
   datetime ti=TimeCurrent()-300;
while(!IsStopped())
{
   RefreshRates();
   double bid1_=iClose(NULL,0,0);
   int res=-1;
   double bandsH=iBands(NULL,0,PeriodBands,Deviation,bands_shift,0,1,0);
   double bandsL=iBands(NULL,0,PeriodBands,Deviation,bands_shift,0,2,0);
   double median=iMA(NULL,0,PeriodBands,0,0,0,0);
   if((bid_<median&&bid1_>median)||(bid_<median&&bid1_<median))
   {
      //CloseAllOrders();
   }
   if(bid_>bandsL&&bid1_<bandsL&&(TimeCurrent()-ti)>300)//iClose(NULL,0,0))
   {
      OrderSend("GBPUSD",OP_BUY,Lot,NormalizeDouble(MarketInfo("GBPUSD",MODE_ASK),MarketInfo("GBPUSD",MODE_DIGITS)),3,0,0,NULL,MAGIK);
      OrderSend("EURUSD",OP_SELL,Lot,NormalizeDouble(MarketInfo("EURUSD",MODE_BID),MarketInfo("EURUSD",MODE_DIGITS)),3,0,0,NULL,MAGIK);
      ti=TimeCurrent();
   }
   if(bid_<bandsH&&bid1_>bandsH&&(TimeCurrent()-ti)>300)//iClose(NULL,0,0))
   {
      OrderSend("GBPUSD",OP_SELL,Lot,NormalizeDouble(MarketInfo("GBPUSD",MODE_BID),MarketInfo("GBPUSD",MODE_DIGITS)),3,0,0,NULL,MAGIK);
      OrderSend("EURUSD",OP_BUY,Lot,NormalizeDouble(MarketInfo("EURUSD",MODE_ASK),MarketInfo("EURUSD",MODE_DIGITS)),3,0,0,NULL,MAGIK);
      ti=TimeCurrent();
   }
   bid_=bid1_;//iClose(NULL,0,0);
   Comment(bandsH," ",bandsL);
   Sleep(50);
}
   return(0);
}
//+------------------------------------------------------------------+
void CloseAllOrders()
{
   for (int k=OrdersTotal()-1;k>=0;k--)
   {
      RefreshRates();
      if (OrderSelect(k,SELECT_BY_POS,MODE_TRADES)==true&&OrderMagicNumber()==MAGIK)
      {
         int cmd=OrderType();
         if(cmd>1)
         {
            OrderDelete(OrderTicket());
         }
         if (cmd==OP_BUY)
         {
            OrderClose(OrderTicket(),OrderLots(),NormalizeDouble(MarketInfo(OrderSymbol(),MODE_BID),MarketInfo(OrderSymbol(),MODE_DIGITS)),Slippage);
         }
         if (cmd==OP_SELL)
         {
            OrderClose(OrderTicket(),OrderLots(),NormalizeDouble(MarketInfo(OrderSymbol(),MODE_ASK),MarketInfo(OrderSymbol(),MODE_DIGITS)),Slippage);  
         }
      }
   }
 
Traderr21:
sanyooooook
THIS CODE?


well, yes, it does look different now, but this one works too (under ideal conditions ))))
 
but it's just a code, not an EA. Can you give me a ready-made EA if you don't mind?))) I just can not write EAs
 
Traderr21:
but it's just a code, not an EA. Can you give me a ready-made EA if you don't mind?))) I just can not write EAs

Sanek, it's time to raise the price to 2500 rubles
Reason: