0
индикатор не дает сигнал правильный, что вы пытаетесь выжать отсюда? *???* 
avatar

AM2

  • 6 ноября 2018, 17:12
0
обрезал чтобы сюда уместить. поправил.
avatar

AM2

  • 6 ноября 2018, 12:38
0
не все индикаторы делают чтобы сигнал снять можно было
avatar

AM2

  • 6 ноября 2018, 12:34
0
не качественный сигнал от индикатора, открывает 2 позы независимо от стрелки:




//+------------------------------------------------------------------+
//|                                                        Diver.mq4 |
//|                                              Copyright 2018, AM2 |
//|                                      http://www.forexsystems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2018, AM2"
#property link      "http://www.forexsystems.biz"
#property version   "1.00"
#property strict

//--- Inputs
extern double Lots       = 0.1;      // лот
extern double KLot       = 1;        // умножение лота
extern double MaxLot     = 5;        // максимальный лот
extern int StopLoss      = 2000;     // лось
extern int TakeProfit    = 3000;     // язь
extern int Slip          = 30;       // реквот
extern int Shift         = 1;        // на каком баре сигнал индикатора
extern int Magic         = 123;      // магик

extern string IndName    = "rsx_nrp_reg_histo_mtfdivergence_nmc";
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   Comment("");
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
   Comment("");
  }

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void PutOrder(int type,double price)
  {
   int r=0;
   color clr=Green;
   double sl=0,tp=0;

   if(type==1 || type==3 || type==5)
     {
      clr=Red;
      if(StopLoss>0) sl=NormalizeDouble(price+StopLoss*Point,Digits);
      if(TakeProfit>0) tp=NormalizeDouble(price-TakeProfit*Point,Digits);
     }

   if(type==0 || type==2 || type==4)
     {
      clr=Blue;
      if(StopLoss>0) sl=NormalizeDouble(price-StopLoss*Point,Digits);
      if(TakeProfit>0) tp=NormalizeDouble(price+TakeProfit*Point,Digits);
     }

   r=OrderSend(NULL,type,Lot(),NormalizeDouble(price,Digits),Slip,sl,tp,"",Magic,0,clr);
   return;
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int CountTrades()
  {
   int count=0;
   for(int i=OrdersTotal()-1;i>=0;i--)
     {
      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
        {
         if(OrderSymbol()==Symbol() && OrderMagicNumber()==Magic)
           {
            if(OrderType()<2) count++;
           }
        }
     }
   return(count);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OpenPos()
  {
   double lim = iCustom(NULL,0,IndName,3,Shift);
   double red = iCustom(NULL,0,IndName,3,Shift);

   if(lim!=EMPTY_VALUE)PutOrder(0,Ask);
   if(red!=EMPTY_VALUE)PutOrder(1,Bid);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void ClosePos()
  {
   double lim = iCustom(NULL,0,IndName,3,Shift);
   double red = iCustom(NULL,0,IndName,4,Shift);

   if(red!=EMPTY_VALUE) CloseAll(0);
   if(lim!=EMPTY_VALUE) CloseAll(1);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
double Lot()
  {
   double lot=Lots;
   for(int i=OrdersHistoryTotal()-1;i>=0;i--)
     {
      if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY))
        {
         if(OrderSymbol()==Symbol() && OrderMagicNumber()==Magic)
           {
            if(OrderProfit()>0) break;
            if(OrderProfit()<0)
              {
               lot=OrderLots()*KLot;
               break;
              }
           }
        }
     }
   if(lot>MaxLot)lot=Lots;
   return(lot);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void CloseAll(int ot=-1)
  {
   bool cl;
   for(int i=OrdersTotal()-1;i>=0;i--)
     {
      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
        {
         if(OrderSymbol()==Symbol() && OrderMagicNumber()==Magic)
           {
            if(OrderType()==0 && (ot==0 || ot==-1))
              {
               RefreshRates();
               cl=OrderClose(OrderTicket(),OrderLots(),NormalizeDouble(Bid,Digits),Slip,White);
              }
            if(OrderType()==1 && (ot==1 || ot==-1))
              {
               RefreshRates();
               cl=OrderClose(OrderTicket(),OrderLots(),NormalizeDouble(Ask,Digits),Slip,White);
              }
           }
        }
     }
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   double lime= iCustom(NULL,0,IndName,3,Shift);
   double red = iCustom(NULL,0,IndName,4,Shift);

   if(CountTrades()<1) OpenPos();
   else ClosePos();


   Comment("\n lime: ",lime,
           "\n red: ",red);
  }
//+------------------------------------------------------------------+
avatar

AM2

  • 6 ноября 2018, 10:45
0
на 14-е
avatar

AM2

  • 5 ноября 2018, 20:06
0
на 13-е
avatar

AM2

  • 4 ноября 2018, 21:23
0
для начала можно попробовать объединить 2, только укажите все на скринах
avatar

AM2

  • 4 ноября 2018, 18:43
0
кнопка не нажата:



кнопка нажата открылась поза:



www.opentraders.ru/downloads/2154/

avatar

AM2

  • 4 ноября 2018, 13:27
0
вот интересно будет


индикатор китайский дракон :) 




//+------------------------------------------------------------------+
//|                                                   InrunInduk.mq4 |
//|                                              Copyright 2018, AM2 |
//|                                      http://www.forexsystems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2018, AM2"
#property link      "http://www.forexsystems.biz"
#property version   "1.00"
#property strict
#property indicator_chart_window

#property indicator_buffers 3

#property indicator_color1 Red
#property indicator_width1 2
#property indicator_color2 Red
#property indicator_width2 2 
#property indicator_color3 Red
#property indicator_width3 2 

double mi[];
double up[];
double dn[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexStyle(0,DRAW_LINE);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexStyle(2,DRAW_LINE);
   SetIndexBuffer(0,mi);
   SetIndexBuffer(1,up);
   SetIndexBuffer(2,dn);
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
//---
   for(int i=0;i<1111;i++)
     {
      mi[i]=(high[i]+low[i])/2;      
      double sum=(high[i]-low[i]);      
      up[i]=mi[i]+sum;
      dn[i]=mi[i]-sum;
     }
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+

avatar

AM2

  • 4 ноября 2018, 11:56
0
на 12-е
avatar

AM2

  • 4 ноября 2018, 10:52
0
На зачем Вы делаете такой советник, который не приносит прибыли и нет никакой логики в работе


оптимизировал всего 2 параметра с начала этого года. поставил на тест с начала 17-го:

avatar

AM2

  • 3 ноября 2018, 23:06
0
общими усилиями <img src='http://opentraders.ru/templates/skin/g6h/images/smilies/002.gif' alt=' :) '>&nbsp; 



www.opentraders.ru/downloads/2152/
avatar

AM2

  • 3 ноября 2018, 20:37
0
среднение не работает, трал не работает. Закрытие получается нет.

ничего этого в задании нет
avatar

AM2

  • 3 ноября 2018, 17:36
0
я смотрел примеры и доки, делал так.

вот массив:

double lev[5]={10,20,30,40,70};


вот он в цикле:


//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void PutFibo(string name,datetime time1,double price1,datetime time2,double price2)
  {
   ObjectDelete(0,name);
   ObjectCreate(0,name,OBJ_FIBO,0,time1,price1,time2,price2);
   for(int i=0;i<5;i++) ObjectSetDouble(0,name,OBJPROP_LEVELVALUE,i,lev[i]); 
   return;
  }


а результата нет:

avatar

AM2

  • 3 ноября 2018, 17:32
+1
по линии киджун буфер 1 советник еще торгует:

avatar

AM2

  • 3 ноября 2018, 10:37
+1
при вызове:


double isi = iIchimoku(NULL,0,Tenkan,Kijun,Senkou,1,Shift);


берутся значения буферов 1-4.

ваша линия 6-й буфер, он при вызове = 0.

вот код можете проверить:


//+------------------------------------------------------------------+
//|                                                         Ishi.mq4 |
//|                                              Copyright 2018, AM2 |
//|                                      http://www.forexsystems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2018, AM2"
#property link      "http://www.forexsystems.biz"
#property version   "1.00"
#property strict

//--- Inputs
extern double Lots       = 0.1;      // лот
extern double KLot       = 2;        // умножение лота
extern double MaxLot     = 5;        // максимальный лот
extern int StopLoss      = 333;      // лось
extern int TakeProfit    = 444;      // язь
extern int BULevel       = 0;        // уровень БУ
extern int BUPoint       = 30;       // пункты БУ
extern int TrailingStop  = 0;        // трал
extern int Slip          = 30;       // реквот
extern int Shift         = 1;        // на каком баре сигнал индикатора
extern int Magic         = 123;      // магик

extern string IndName="Hist_StepMA_Stoch_KV1_Ex_03";

extern int PeriodWATR    = 10;
extern double Kwatr      = 1.0000;

input int Tenkan         = 9;        // Tenkan-sen
input int Kijun          = 26;       // Kijun-sen
input int Senkou         = 52;       // Senkou Span B
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   Comment("");
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
   Comment("");
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void PutOrder(int type,double price)
  {
   int r=0;
   color clr=Green;
   double sl=0,tp=0;

   if(type==1 || type==3 || type==5)
     {
      clr=Red;
      if(StopLoss>0) sl=NormalizeDouble(price+StopLoss*Point,Digits);
      if(TakeProfit>0) tp=NormalizeDouble(price-TakeProfit*Point,Digits);
     }

   if(type==0 || type==2 || type==4)
     {
      clr=Blue;
      if(StopLoss>0) sl=NormalizeDouble(price-StopLoss*Point,Digits);
      if(TakeProfit>0) tp=NormalizeDouble(price+TakeProfit*Point,Digits);
     }

   r=OrderSend(NULL,type,Lot(),NormalizeDouble(price,Digits),Slip,sl,tp,"",Magic,0,clr);
   return;
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int CountTrades()
  {
   int count=0;
   for(int i=OrdersTotal()-1;i>=0;i--)
     {
      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
        {
         if(OrderSymbol()==Symbol() && OrderMagicNumber()==Magic)
           {
            if(OrderType()<2) count++;
           }
        }
     }
   return(count);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
double Lot()
  {
   double lot=Lots;
   for(int i=OrdersHistoryTotal()-1;i>=0;i--)
     {
      if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY))
        {
         if(OrderSymbol()==Symbol() && OrderMagicNumber()==Magic)
           {
            if(OrderProfit()>0) break;
            if(OrderProfit()<0)
              {
               lot=OrderLots()*KLot;
               break;
              }
           }
        }
     }
   if(lot>MaxLot)lot=Lots;
   return(lot);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void Trailing()
  {
   bool mod;
   for(int i=OrdersTotal()-1;i>=0;i--)
     {
      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
        {
         if(OrderSymbol()==Symbol() && OrderMagicNumber()==Magic)
           {
            if(OrderType()==OP_BUY)
              {
               if(Bid-OrderOpenPrice()>TrailingStop*Point)
                 {
                  if(OrderStopLoss()<Bid-TrailingStop*Point)
                    {
                     mod=OrderModify(OrderTicket(),OrderOpenPrice(),Bid-TrailingStop*Point,OrderTakeProfit(),0,Yellow);
                     return;
                    }
                 }
              }

            if(OrderType()==OP_SELL)
              {
               if((OrderOpenPrice()-Ask)>TrailingStop*Point)
                 {
                  if((OrderStopLoss()>(Ask+TrailingStop*Point)) || (OrderStopLoss()==0))
                    {
                     mod=OrderModify(OrderTicket(),OrderOpenPrice(),Ask+TrailingStop*Point,OrderTakeProfit(),0,Yellow);
                     return;
                    }
                 }
              }
           }
        }
     }
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void BU()
  {
   bool m;
   for(int i=OrdersTotal()-1;i>=0;i--)
     {
      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
        {
         if(OrderSymbol()==Symbol() && OrderMagicNumber()==Magic)
           {
            if(OrderType()==OP_BUY)
              {
               if(OrderOpenPrice()<=(Bid-(BULevel+BUPoint)*Point) && OrderOpenPrice()>OrderStopLoss())
                 {
                  m=OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()+BUPoint*Point,OrderTakeProfit(),0,Yellow);
                  return;
                 }
              }

            if(OrderType()==OP_SELL)
              {
               if(OrderOpenPrice()>=(Ask+(BULevel+BUPoint)*Point) && (OrderOpenPrice()<OrderStopLoss() || OrderStopLoss()==0))
                 {
                  m=OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()-BUPoint*Point,OrderTakeProfit(),0,Yellow);
                  return;
                 }
              }
           }
        }
     }
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   if(BULevel>0) BU();
   if(TrailingStop>0) Trailing();

   double isi  = iIchimoku(NULL,0,Tenkan,Kijun,Senkou,1,Shift);
   double red  = iCustom(NULL,0,IndName,PeriodWATR,Kwatr,0,Shift);
   double gre  = iCustom(NULL,0,IndName,PeriodWATR,Kwatr,1,Shift);

   if(CountTrades()<1)
     {
      if(Close[1]>isi && Close[2]<isi) PutOrder(0,Ask);
      if(Close[1]<isi && Close[2]>isi) PutOrder(1,Bid);
     }

   Comment(isi);
  }
//+------------------------------------------------------------------+



www.opentraders.ru/downloads/2156/
avatar

AM2

  • 3 ноября 2018, 10:19
Начать торговлю с Альпари