+1
Но разве в компилированном виде индикаторы нельзя разве использовать в советнике? Вроде ведь можно?

В большинстве случаев можно.
avatar

AM2

  • 1 февраля 2016, 18:58
0
Усреднение с шагом и увеличивающимся лотом могу сделать. А далее попрошу все как можно подробнее и со скринами, чтобы было наглядно.
avatar

AM2

  • 1 февраля 2016, 17:19
0
Я сделал с какой свечи рассчитывать.

extern int Sdvig = 1; // с какой свечи считаем




с возможностью изменения цвета, размера и места расположения на графике данных значений.


А вот с этого момента поподробнее пожалуйста.

www.opentraders.ru/downloads/1026/
avatar

AM2

  • 1 февраля 2016, 10:09
0
У вас файл не прикрепился. Подождите пока поправят и буду смотреть.
avatar

AM2

  • 1 февраля 2016, 09:39
0
дельту можно задать и плюс и минус а индент у меня смотрит за тем на сколько цена зашла во внутрь канала.
avatar

AM2

  • 31 января 2016, 21:13
0
Это все есть. Вы смотрели последнюю версию?
avatar

AM2

  • 31 января 2016, 21:05
0
Думал, предельно понятно описал что к чему в техзадании))


Сделайте на скрине, чтобы наглядно было.
avatar

AM2

  • 31 января 2016, 20:53
+1
На мой взгляд пользы от этого советника будет не больше чем от пересечения машек.
avatar

AM2

  • 31 января 2016, 20:51
0
У меня дельта расстояние от вершин во вне, а индент во внутрь. Также закрывает открытую позу через экспирэйшн часов.




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

//--- Inputs
extern double Lots      = 0.1; // объем позиции
extern int StopLoss     = 500; // стоп лосс ордера
extern int TakeProfit   = 500; // тейк профит ордера
extern int Expiration   = 10;  // время истечения ордера
extern int Slip         = 30;  // реквот
extern int Type         = 0;   // 0-Stop. 1-Limit
extern int Start        = 11;  // час торговли
extern int Count        = 8;   // сколько часов назад
extern int Delta        = 100; // расстояние от вершин +
extern int Indent       = 100; // расстояние от вершин -
extern int Magic        = 333; // магик
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---

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

  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void PutOrder(int type,double price)
  {
   int    r=0;
   color clr=clrNONE;
   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,Lots,NormalizeDouble(price,Digits),Slip,sl,tp,"",Magic,TimeCurrent()+Expiration*3600,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()==0 || OrderType()==1) count++;
           }
        }
     }
   return(count);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int CountOrders(int type)
  {
   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) count++;
           }
        }
     }
   return(count);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
datetime OpenTime()
  {
   datetime t=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) t=OrderOpenTime();
           }
        }
     }
   return(t);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void CloseAll()
  {
   bool cl;
   for(int i=OrdersTotal()-1;i>=0;i--)
     {
      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
        {
         if(OrderMagicNumber()==Magic || OrderSymbol()==Symbol())
           {
            if(OrderType()==OP_BUY) cl=OrderClose(OrderTicket(),OrderLots(),Bid,Slip,Blue);
            if(OrderType()==OP_SELL) cl=OrderClose(OrderTicket(),OrderLots(),Ask,Slip,Red);
           }
         Sleep(1000);
        }
     }
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   double h=High[iHighest(NULL,0,MODE_HIGH,Count,0)];
   double l=Low[iLowest(NULL,0,MODE_LOW,Count,0)];

   if(Hour()==Start && CountTrades()<1)
     {
      if(Type==0)
        {
         if(CountOrders(4)<1 && h-Bid>Indent*Point) PutOrder(4,h+Delta*Point);
         if(CountOrders(5)<1 && Bid-l>Indent*Point) PutOrder(5,l-Delta*Point);
        }

      if(Type==1)
        {
         if(CountOrders(2)<1 && h-Bid>Indent*Point) PutOrder(2,l-Delta*Point);
         if(CountOrders(3)<1 && Bid-l>Indent*Point) PutOrder(3,h+Delta*Point);
        }
     }

   if(CountTrades()>0 && TimeCurrent()-OpenTime()>Expiration*3600)
     {
      CloseAll();
     }
  }
//+------------------------------------------------------------------+

avatar

AM2

  • 31 января 2016, 20:43
0
добавьте пожалуйста советнику возможность выбора торговли для ордеров, как в «Hello Lock 2».
BuySell = 0; // направление серии 0-оба. 1-бай. 2-селл.

Добавил: www.opentraders.ru/downloads/1008/
avatar

AM2

  • 31 января 2016, 19:09
0
Вы пользовались поиском? Здесь несколько советников на ТМА. Они вам не подошли?

zakaz.opentraders.ru/26970.html
zakaz.opentraders.ru/26169.html
avatar

AM2

  • 31 января 2016, 19:02
0
Смотрите. Этот заказ пойдет уже на следующий месяц.



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

//--- Inputs
extern double Lots      = 0.1; // объем позиции
extern int StopLoss     = 500; // стоп лосс ордера
extern int TakeProfit   = 500; // тейк профит ордера
extern int Expiration   = 10;  // время истечения ордера
extern int Slip         = 30;  // реквот
extern int Type         = 0;   // 0-Stop. 1-Limit
extern int Start        = 11;  // час торговли
extern int Count        = 8;   // сколько часов назад
extern int Delta        = 100; // расстояние от вершин +
extern int Indent       = 100; // расстояние от вершин -
extern int Magic        = 333; // магик
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---

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

  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void PutOrder(int type,double price)
  {
   int    r=0;
   color clr=clrNONE;
   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,Lots,NormalizeDouble(price,Digits),Slip,sl,tp,"",Magic,TimeCurrent()+Expiration*3600,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()==0 || OrderType()==1) count++;
           }
        }
     }
   return(count);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int CountOrders(int type)
  {
   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) count++;
           }
        }
     }
   return(count);
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   double h=High[iHighest(NULL,0,MODE_HIGH,Count,0)];
   double l=Low[iLowest(NULL,0,MODE_LOW,Count,0)];

   if(Hour()==Start && CountTrades()<1)
     {
      if(Type==0)
        {
         if(CountOrders(4)<1 && h-Bid>Indent*Point) PutOrder(4,h);
         if(CountOrders(5)<1 && Bid-l>Indent*Point) PutOrder(5,l);
        }

      if(Type==1)
        {
         if(CountOrders(2)<1 && h-Bid>Indent*Point) PutOrder(2,l);
         if(CountOrders(3)<1 && Bid-l>Indent*Point) PutOrder(3,h);
        }
     }
  }
//+------------------------------------------------------------------+

avatar

AM2

  • 31 января 2016, 18:29
0
Завтра буду смотреть.
avatar

AM2

  • 31 января 2016, 17:41
0
Нужна ссылка на индикатор TMA with Distances.
avatar

AM2

  • 29 января 2016, 18:15
0
Открывает. Возможные причины: открыт еще один ордер этим советником или счет есн стп. А так нужно смотреть логи и заниматься отладкой.

avatar

AM2

  • 29 января 2016, 07:48
0
Сделал:




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

//--- Inputs
extern int    StopLoss     = 0;
extern int    TakeProfit   = 200;
extern int    Step         = 300;
extern int    Slip         = 30;
extern int    Magic        = 123;
extern double Lots         = 0.1;
extern double KLot         = 2;
extern double MaxLot       = 5;

double Price=0,lot=Lots;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---

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

  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
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()==OP_BUY || OrderType()==OP_SELL)
               count++;
           }
        }
     }
   return(count);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void PutOrder(int type,double price)
  {
   int    r=0;
   color clr=clrNONE;
   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);
     }

   if(AccountFreeMarginCheck(Symbol(),type,lot)<=0 || GetLastError()==134)
     {
      Print("Недостаточно средств!!!");
     }

   if(GetLastError()==131)
     {
      Print("Неправильный объем!!!");
     }

   if(lot>MaxLot) lot=Lots;
   r=OrderSend(NULL,type,lot,NormalizeDouble(price,Digits),Slip,sl,tp,"",Magic,0,clr);
   return;
//---
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {

   if(Bid>Price+Step*Point || Bid<Price-Step*Point)
     {
      PutOrder(0,Ask);
      PutOrder(1,Bid);
      Price=Bid;
      lot*=KLot;
     }

   if(CountTrades()<2)
     {
      PutOrder(0,Ask);
      PutOrder(1,Bid);
      Price=Bid;
      lot*=KLot;
     }
     
   Comment("\n Price: ",Price,"\n Lot: ",lot);
  }
//+------------------------------------------------------------------+

avatar

AM2

  • 29 января 2016, 07:38
0
avatar

AM2

  • 28 января 2016, 08:53
0
Открывает, умножает:




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

//--- Inputs
extern int    StopLoss     = 0;
extern int    TakeProfit   = 0;
extern int    Step         = 300;
extern int    Slip         = 30;
extern int    Magic        = 123;
extern double Lots         = 0.1;
extern double KLot         = 2;

double Price=0, lot=Lots;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---

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

  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void PutOrder(int type,double price)
  {
   int    r=0;
   color clr=clrNONE;
   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;
//---
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//--- sell conditions
   if(Bid>Price+Step*Point || Bid<Price-Step*Point)
     {
      PutOrder(0,Ask);
      PutOrder(1,Bid);
      Price=Bid;
      lot*=KLot;
     }
     
     Comment("\n Price: ",Price,"\n Lot: ",lot);
  }
//+------------------------------------------------------------------+

avatar

AM2

  • 28 января 2016, 08:14