0
после праздников посмотрю.
avatar

AM2

  • 23 февраля 2018, 10:59
0
Один заказ в месяц.
avatar

AM2

  • 23 февраля 2018, 08:32
0
сделаем?


мне теперь примерно столько же копать нужно чтобы вывести стрелки через буферы.

Сделать направления тейк профита через буферы


этот момент я понял так что нужны значения тейков и стопа через буферы.

в следующем топе буду смотреть как вывести стрелки через буфер. Просьба писать более подробное тз со скринами.
avatar

AM2

  • 22 февраля 2018, 20:12
0
а эти стрелки через буфер вывести можно?

почему сразу об этом не написали?
avatar

AM2

  • 22 февраля 2018, 18:23
0
я только пишу индикаторы с нуля по тз, чужие не дорабатываю.
avatar

AM2

  • 22 февраля 2018, 16:45
0
с чужим кодом не ко мне.
avatar

AM2

  • 21 февраля 2018, 22:03
+1
нет четкого сигнала от индикатора SSG HASignal.
см. набросок:


//+------------------------------------------------------------------+
//|                                                          SSG.mq4 |
//|                                              Copyright 2018, AM2 |
//|                                      http://www.forexsyatems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2018, AM2"
#property link      "http://www.forexsyatems.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    = "SSG_HASignal";
//+------------------------------------------------------------------+
//| 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 buy  = iCustom(NULL,0,IndName,0,Shift);
   double sell = iCustom(NULL,0,IndName,1,Shift);

   if(buy<1000)
     {
      PutOrder(0,Ask);
     }

   if(sell<1000)
     {
      PutOrder(1,Bid);
     }
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void ClosePos()
  {
   double buy  = iCustom(NULL,0,IndName,0,Shift);
   double sell = iCustom(NULL,0,IndName,1,Shift);

   if(sell<1000)
     {
      CloseAll(0);
     }

   if(buy<1000)
     {
      CloseAll(1);
     }
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
double Lot()
  {
   double lot=Lots;
   for(int i=OrdersHistoryTotal()-1;i>=0;i--)
     {
      if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY))
        {
         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 buy  = iCustom(NULL,0,IndName,0,Shift);
   double sell = iCustom(NULL,0,IndName,1,Shift);

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

   Comment("\n buy: ",buy,
           "\n sell: ",sell);
  }
//+------------------------------------------------------------------+

avatar

AM2

  • 21 февраля 2018, 21:35
0
вообще NO :) 
avatar

AM2

  • 21 февраля 2018, 18:07
0
логи скрины настройки в студию
avatar

AM2

  • 21 февраля 2018, 17:56
0
на 26-е
avatar

AM2

  • 21 февраля 2018, 17:54
0
*shock*  NO :D 
avatar

AM2

  • 21 февраля 2018, 17:51
0
а) отлоги удаляет
б) имеющиеся сделки закрывает


есть. отключаемая функция.

На открытии нового дня:


ставьте на д1
avatar

AM2

  • 20 февраля 2018, 21:41
+1
Готово: www.opentraders.ru/downloads/1810/



Индикатор переименовал, т.к. терминал не хотел воспринимать пробелы:

extern string IndName="FlatTrendRSI";
avatar

AM2

  • 20 февраля 2018, 21:09
0
сейчас начну делать.
avatar

AM2

  • 20 февраля 2018, 20:20
0
Я попытался вписать функцию, но советник ссылку на который вы мне дали заточен под совершенно другое тз.




//+------------------------------------------------------------------+
//|                                                    ParaOtlog.mq4 |
//|                                              Copyright 2017, AM2 |
//|                                      http://www.forexsyatems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2017, AM2"
#property link      "http://www.forexsyatems.biz"
#property version   "1.00"
#property strict

//--- Inputs
extern double Lots       = 0.1;      // лот
extern double KLot       = 1;        // умножение лота
extern double MaxLot     = 5;        // максимальный лот
extern int StopLoss      = 300;      // лось
extern int TakeProfit    = 400;      // язь
extern int Slip          = 30;       // реквот
extern int Delta         = 100;      // расстояние от цены
extern int Type          = 0;        // 0-stop 1-limit
extern int Del           = 1;        // 1-удалять другую
extern int Mod           = 1;        // 1-модим ордер
extern int Magic         = 123;      // магик

datetime t=0;
//+------------------------------------------------------------------+
//| 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(OrderProfit()>0) break;
         if(OrderProfit()<0)
           {
            lot=OrderLots()*KLot;
            break;
           }
        }
     }
   if(lot>MaxLot)lot=Lots;
   return(lot);
  }
//+------------------------------------------------------------------+
//| Удаление отложенных ордеров                                      |
//+------------------------------------------------------------------+
void DelOrder()
  {
   bool del;
   for(int i=OrdersTotal()-1;i>=0;i--)
     {
      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
        {
         if(OrderSymbol()==Symbol() && OrderMagicNumber()==Magic)
           {
            if(OrderType()>1) del=OrderDelete(OrderTicket());
           }
        }
     }
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
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);
              }
           }
        }
     }
  }
//+------------------------------------------------------------------+
//| Подсчет ордеров по типу                                          |
//+------------------------------------------------------------------+
int CountOrders(int type=-1)
  {
   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()==type || type==-1) count++;
           }
        }
     }
   return(count);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void Mode(double op)
  {
   bool m;
   for(int i=OrdersTotal()-1;i>=0;i--)
     {
      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
        {
         if(OrderSymbol()==Symbol() && OrderMagicNumber()==Magic)
           {
            if(OrderOpenPrice()!=op)
              {
               if(OrderType()==4)
                 {
                  m=OrderModify(OrderTicket(),op,op-StopLoss*Point,op+TakeProfit*Point,OrderExpiration(),Yellow);
                  return;
                 }
               if(OrderType()==5)
                 {
                  m=OrderModify(OrderTicket(),op,op+StopLoss*Point,op-TakeProfit*Point,OrderExpiration(),Yellow);
                  return;
                 }
              }
           }
        }
     }
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   double open=iOpen(NULL,PERIOD_D1,0);

   if(CountOrders(0)>0 || CountOrders(1)>0)
     {
      if(Mod>0) Mode(open);
     }

   if(t!=Time[0])
     {
      CloseAll();

      if(Type==0)
        {
         if(Bid-open<Delta*Point) PutOrder(4,open+Delta*Point);
         if(open-Bid<Delta*Point) PutOrder(5,open-Delta*Point);
        }

      if(Type==1)
        {
         if(Bid-open<Delta*Point) PutOrder(3,open+Delta*Point);
         if(open-Bid<Delta*Point) PutOrder(2,open-Delta*Point);
        }
      t=Time[0];
     }

   if(Del>0 && CountTrades()>0) DelOrder();
  }
//+------------------------------------------------------------------+

avatar

AM2

  • 20 февраля 2018, 20:19
0
расшифруйте где что.
avatar

AM2

  • 20 февраля 2018, 17:29