0
мб он только для азии?))

Желающие могут ставить в любое время. Доработки через стол заказов.
avatar

AM2

  • 24 ноября 2016, 00:22
0
Готово: www.opentraders.ru/downloads/1394/




//+------------------------------------------------------------------+
//|                                                          4MA.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
#property indicator_chart_window

#property indicator_buffers 8

#property indicator_color1 Red
#property indicator_color2 Red
#property indicator_color3 Red
#property indicator_color4 Red
#property indicator_color5 Blue
#property indicator_color6 Aqua
#property indicator_color7 Blue
#property indicator_color8 Aqua

#property indicator_style1 2
#property indicator_style2 2
#property indicator_style3 2
#property indicator_style4 2

input int MA1Period = 10;
input int MA2Period = 20;
input int MA3Period = 30;
input int MA4Period = 40;

input int MA1Shift = 0;
input int MA2Shift = 0;
input int MA3Shift = 0;
input int MA4Shift = 0;

input int MA1Method = 0;
input int MA2Method = 0;
input int MA3Method = 0;
input int MA4Method = 0;

input int MA1Price = 0;
input int MA2Price = 0;
input int MA3Price = 0;
input int MA4Price = 0;

input int EN1Period = 15;
input int EN2Period = 25;

input int EN1Method = 0;
input int EN2Method = 0;

input int EN1Shift = 0;
input int EN2Shift = 0;

input int EN1Price = 0;
input int EN2Price = 0;

input int EN1Mode = 0;
input int EN2Mode = 0;

input double EN1Dev = 0.2;
input double EN2Dev = 0.2;

double MA1Buffer[];
double MA2Buffer[];
double MA3Buffer[];
double MA4Buffer[];

double EN1UPBuffer[];
double EN2UPBuffer[];
double EN1DNBuffer[];
double EN2DNBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexStyle(0,DRAW_LINE);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexStyle(2,DRAW_LINE);
   SetIndexStyle(3,DRAW_LINE);
   SetIndexStyle(4,DRAW_LINE);
   SetIndexStyle(5,DRAW_LINE);
   SetIndexStyle(6,DRAW_LINE);
   SetIndexStyle(7,DRAW_LINE);

   SetIndexBuffer(0,MA1Buffer);
   SetIndexBuffer(1,MA2Buffer);
   SetIndexBuffer(2,MA3Buffer);
   SetIndexBuffer(3,MA4Buffer);
   SetIndexBuffer(4,EN1UPBuffer);
   SetIndexBuffer(5,EN2UPBuffer);
   SetIndexBuffer(6,EN1DNBuffer);
   SetIndexBuffer(7,EN2DNBuffer);
//---
   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<=10000;i++)
     {
      MA1Buffer[i]=iMA(NULL,0,MA1Period,MA1Shift,MA1Method,MA1Price,i);
      MA2Buffer[i]=iMA(NULL,0,MA2Period,MA2Shift,MA2Method,MA2Price,i);
      MA3Buffer[i]=iMA(NULL,0,MA3Period,MA3Shift,MA3Method,MA3Price,i);
      MA4Buffer[i]=iMA(NULL,0,MA4Period,MA4Shift,MA4Method,MA4Price,i);

      EN1UPBuffer[i]=iEnvelopes(NULL,0,EN1Period,EN1Method,EN1Shift,EN1Price,EN1Dev,0,i);
      EN2UPBuffer[i]=iEnvelopes(NULL,0,EN2Period,EN2Method,EN2Shift,EN2Price,EN2Dev,0,i);

      EN1DNBuffer[i]=iEnvelopes(NULL,0,EN1Period,EN1Method,EN1Shift,EN1Price,EN1Dev,1,i);
      EN2DNBuffer[i]=iEnvelopes(NULL,0,EN2Period,EN2Method,EN2Shift,EN2Price,EN2Dev,1,i);
     }
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+

avatar

AM2

  • 24 ноября 2016, 00:07
0
Сегодня начну делать.
avatar

AM2

  • 23 ноября 2016, 22:55
0
Готово: www.opentraders.ru/downloads/1395/


//+------------------------------------------------------------------+
//|                                                BalanceProfit.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

#include <WinUser32.mqh>

#define PAUSE      10
#define VK_CONTROL 0x11 //CTRL key
#define KEY_CODE   'E'

extern int    Slip      = 30;       // реквот
extern double Loss      = 10;       // убыток в валюте
extern double Profit    = 10;       // профит в валюте
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---

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

  }
//+------------------------------------------------------------------+
//| Закрытие позиции по типу ордера                                  |
//+------------------------------------------------------------------+
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())
           {
            if(OrderType()==0 && (ot==0 || ot==-1))
              {
               RefreshRates();
               cl=OrderClose(OrderTicket(),OrderLots(),NormalizeDouble(Bid,Digits),Slip,Lime);
              }
            if(OrderType()==1 && (ot==1 || ot==-1))
              {
               RefreshRates();
               cl=OrderClose(OrderTicket(),OrderLots(),NormalizeDouble(Ask,Digits),Slip,Lime);
              }
           }
        }
     }
  }
//+------------------------------------------------------------------+
//| Профит всех ордеров по типу ордера                               |
//+------------------------------------------------------------------+
double AllProfit(int ot=-1)
  {
   double pr=0;
   for(int i=OrdersTotal()-1;i>=0;i--)
     {
      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
        {
         if(OrderSymbol()==Symbol())
           {
            if(OrderType()==0 && (ot==0 || ot==-1))
              {
               pr+=OrderProfit()+OrderCommission()+OrderSwap();
              }

            if(OrderType()==1 && (ot==1 || ot==-1))
              {
               pr+=OrderProfit()+OrderCommission()+OrderSwap();
              }
           }
        }
     }
   return(pr);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void Key()
  {
   keybd_event(VK_CONTROL,0,0,0);
   Sleep(PAUSE);
   keybd_event(KEY_CODE,0,0,0);
   Sleep(PAUSE);
   keybd_event(KEY_CODE,0,2,0);
   Sleep(PAUSE);
   keybd_event(VK_CONTROL,0,2,0);
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {

   if(IsTradeAllowed() && (AllProfit()>Profit || AllProfit()<-Loss))
     {
      CloseAll();
      Key();
     }
  }
//+------------------------------------------------------------------+

avatar

AM2

  • 23 ноября 2016, 22:51
0
Посмотрю сегодня.
avatar

AM2

  • 23 ноября 2016, 17:24
0
Кочерга на моем счете, авторскому советнику до кочерги осталось 100 п.
avatar

AM2

  • 23 ноября 2016, 17:10
+1
Обновил и скинул кодом: www.opentraders.ru/downloads/1392/

//+------------------------------------------------------------------+
//|                                                    Parabolic.mq4 |
//|                   Copyright 2005-2014, MetaQuotes Software Corp. |
//|                                              http://www.mql4.com |
//+------------------------------------------------------------------+
#property copyright   "2005-2014, MetaQuotes Software Corp."
#property link        "http://www.mql4.com"
#property description "Parabolic Stop-And-Reversal system"
#property strict

//--- indicator settings
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1  Lime
//--- input parameters
input double InpSARStep=0.02;    // Step
input double InpSARMaximum=0.2;  // Maximum
input int Points=32;

//---- buffers
double       ExtSARBuffer[];
//--- global variables
double       ExtSarStep;
double       ExtSarMaximum;
int          ExtLastReverse;
bool         ExtDirectionLong;
double       ExtLastStep,ExtLastEP,ExtLastSAR;
double       ExtLastHigh,ExtLastLow;
int points=0,up=0,dn=0;
datetime t=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
void OnInit()
  {
//--- checking input data
   if(InpSARStep<0.0)
     {
      ExtSarStep=0.02;
      Print("Input parametr InpSARStep has incorrect value. Indicator will use value ",
            ExtSarStep," for calculations.");
     }
   else
      ExtSarStep=InpSARStep;
   if(InpSARMaximum<0.0)
     {
      ExtSarMaximum=0.2;
      Print("Input parametr InpSARMaximum has incorrect value. Indicator will use value ",
            ExtSarMaximum," for calculations.");
     }
   else
      ExtSarMaximum=InpSARMaximum;
//--- drawing settings
   IndicatorDigits(Digits);
   SetIndexStyle(0,DRAW_ARROW);
   SetIndexArrow(0,159);
//---- indicator buffers
   SetIndexBuffer(0,ExtSARBuffer);
//--- set short name
   IndicatorShortName("SAR("+DoubleToString(ExtSarStep,2)+","+DoubleToString(ExtSarMaximum,2)+")");
//--- set global variables
   ExtLastReverse=0;
   ExtDirectionLong=false;
   ExtLastStep=ExtLastEP=ExtLastSAR=0.0;
   ExtLastHigh=ExtLastLow=0.0;
//----
  }
//+------------------------------------------------------------------+
//| Parabolic SAR                                                    |
//+------------------------------------------------------------------+
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[])
  {
   bool   dir_long;
   double last_high,last_low,ep,sar,step;
   int    i;
//--- check for minimum rates count
   if(rates_total<3)
      return(0);
//--- counting from 0 to rates_total
   ArraySetAsSeries(ExtSARBuffer,false);
   ArraySetAsSeries(high,false);
   ArraySetAsSeries(low,false);
//--- detect current position for calculations 
   i=prev_calculated-1;
//--- calculations from start?
   if(i<1)
     {
      ExtLastReverse=0;
      dir_long=true;
      step=ExtSarStep;
      last_high=-10000000.0;
      last_low=10000000.0;
      sar=0;
      i=1;
      while(i<rates_total-1)
        {
         ExtLastReverse=i;
         if(last_low>low[i])
            last_low=low[i];
         if(last_high<high[i])
            last_high=high[i];
         if(high[i]>high[i-1] && low[i]>low[i-1])
            break;
         if(high[i]<high[i-1] && low[i]<low[i-1])
           {
            dir_long=false;
            break;
           }
         i++;
        }
      //--- initialize with zero
      ArrayInitialize(ExtSARBuffer,0.0);
      //--- go check
      if(dir_long)
        {
         ExtSARBuffer[i]=low[i-1];
         ep=high[i];
        }
      else
        {
         ExtSARBuffer[i]=high[i-1];
         ep=low[i];
        }
      i++;
     }
   else
     {
      //--- calculations to be continued. restore last values
      i=ExtLastReverse;
      step=ExtLastStep;
      dir_long=ExtDirectionLong;
      last_high=ExtLastHigh;
      last_low=ExtLastLow;
      ep=ExtLastEP;
      sar=ExtLastSAR;
     }
//---main cycle
   while(i<rates_total)
     {
      //--- check for reverse
      if(dir_long && low[i]<ExtSARBuffer[i-1])
        {
         SaveLastReverse(i,true,step,low[i],last_high,ep,sar);
         step=ExtSarStep;
         dir_long=false;
         ep=low[i];
         last_low=low[i];
         ExtSARBuffer[i++]=last_high;
         continue;
        }
      if(!dir_long && high[i]>ExtSARBuffer[i-1])
        {
         SaveLastReverse(i,false,step,last_low,high[i],ep,sar);
         step=ExtSarStep;
         dir_long=true;
         ep=high[i];
         last_high=high[i];
         ExtSARBuffer[i++]=last_low;
         continue;
        }
      //---
      sar=ExtSARBuffer[i-1]+step*(ep-ExtSARBuffer[i-1]);
      //--- LONG?
      if(dir_long)
        {
         if(ep<high[i])
           {
            if((step+ExtSarStep)<=ExtSarMaximum)
               step+=ExtSarStep;
           }
         if(high[i]<high[i-1] && i==2)
            sar=ExtSARBuffer[i-1];
         if(sar>low[i-1])
            sar=low[i-1];
         if(sar>low[i-2])
            sar=low[i-2];
         if(sar>low[i])
           {
            SaveLastReverse(i,true,step,low[i],last_high,ep,sar);
            step=ExtSarStep; dir_long=false; ep=low[i];
            last_low=low[i];
            ExtSARBuffer[i++]=last_high;
            continue;
           }
         if(ep<high[i])
            ep=last_high=high[i];
        }
      else // SHORT
        {
         if(ep>low[i])
           {
            if((step+ExtSarStep)<=ExtSarMaximum)
               step+=ExtSarStep;
           }
         if(low[i]<low[i-1] && i==2)
            sar=ExtSARBuffer[i-1];
         if(sar<high[i-1])
            sar=high[i-1];
         if(sar<high[i-2])
            sar=high[i-2];
         if(sar<high[i])
           {
            SaveLastReverse(i,false,step,last_low,high[i],ep,sar);
            step=ExtSarStep;
            dir_long=true;
            ep=high[i];
            last_high=high[i];
            ExtSARBuffer[i++]=last_low;
            continue;
           }
         if(ep>low[i])
            ep=last_low=low[i];
        }
      ExtSARBuffer[i++]=sar;
     }
   if(t!=Time[0])
     {
      points++;
      if(Bid>ExtSARBuffer[rates_total-1]) up++;
      if(Bid<ExtSARBuffer[rates_total-1]) dn++;
      if(points>Points && up<dn)
        {
         Alert(Symbol()+"UP!!!");
         points=0;up=0;dn=0;
        }
      if(points>Points && up>dn) 
        {
         Alert(Symbol()+"DN!!!");
         points=0;up=0;dn=0;
        }
      t=Time[0];
     }
   Comment("\n Points: ",points,
           "\n UP Points: ",up,
           "\n DN Points: ",dn,
           "\n SAR: ",NormalizeDouble(ExtSARBuffer[rates_total-1],Digits),
           "\n Rates Total: ",rates_total);
//---- OnCalculate done. Return new prev_calculated.
   return(rates_total);
  }
//+------------------------------------------------------------------+
//|  save last values to continue further calculations               |
//+------------------------------------------------------------------+
void SaveLastReverse(int reverse,bool dir,double step,double last_low,double last_high,double ep,double sar)
  {
   ExtLastReverse=reverse;
   if(ExtLastReverse<2)
      ExtLastReverse=2;
   ExtDirectionLong=dir;
   ExtLastStep=step;
   ExtLastLow=last_low;
   ExtLastHigh=last_high;
   ExtLastEP=ep;
   ExtLastSAR=sar;
  }
//+------------------------------------------------------------------+

avatar

AM2

  • 22 ноября 2016, 18:28
0
Где то до 24 на есн спреды 3-6 и комиссия 3-4 долл.
avatar

AM2

  • 22 ноября 2016, 00:34
0
наверно надо на тестер переходить но блин не удобно то что нельзя тейк и стоп двигать на экране и два ордера открывать.

Здесь реализовано с несколькими ордерами, но без линий.
strategy.opentraders.ru/36047.html
Все необходимое могу добавить в столе заказов.
avatar

AM2

  • 21 ноября 2016, 18:42
0
Скинул в базу исправленный вариант: www.opentraders.ru/downloads/1389/
avatar

AM2

  • 19 ноября 2016, 19:28
0
Cделайте отдельный заказ, а то у этого уже срок годности вышел :D 
avatar

AM2

  • 18 ноября 2016, 20:19
0
В половинах по времени сделал:




//+------------------------------------------------------------------+
//|                                                     TickInfo.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
#property indicator_chart_window

datetime t=0;
double LastHigh=0,LastLow=0,LastBid=0;
uint tTime=0,ttTime=0,stTime=0,sttTime=0;
int th=0,tl=0,sh=0,sl=0,TickCount=0,tTick=0,ttTick=0,tttTick=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping

//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
   ObjectsDeleteAll();
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void PutLabel(string name,int x,int y,string text)
  {
   ObjectDelete(0,name);
//--- создадим текстовую метку
   ObjectCreate(0,name,OBJ_LABEL,0,0,0);
//--- установим координаты метки
   ObjectSetInteger(0,name,OBJPROP_XDISTANCE,x);
   ObjectSetInteger(0,name,OBJPROP_YDISTANCE,y);
//--- установим угол графика, относительно которого будут определяться координаты точки
   ObjectSetInteger(0,name,OBJPROP_CORNER,1);
//--- установим текст
   ObjectSetString(0,name,OBJPROP_TEXT,text);
//--- установим шрифт текста
   ObjectSetString(0,name,OBJPROP_FONT,"Arial");
//--- установим размер шрифта
   ObjectSetInteger(0,name,OBJPROP_FONTSIZE,8);
//--- установим цвет
   ObjectSetInteger(0,name,OBJPROP_COLOR,Red);
//--- скроем (true) или отобразим (false) имя графического объекта в списке объектов
   ObjectSetInteger(0,name,OBJPROP_HIDDEN,false);
  }
//+------------------------------------------------------------------+
//| 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[])
  {
//---
   if(LastBid!=Bid)
     {
      TickCount++;
      if(TimeCurrent()>time[0] && TimeCurrent()<time[0]+PeriodSeconds()/2)
        {
         tTick++;
         tTime+=(GetTickCount()-stTime);
        }
      if(TimeCurrent()>time[0]+PeriodSeconds()/2 && TimeCurrent()<time[0]+PeriodSeconds())
        {
         ttTick++;
         ttTime+=(GetTickCount()-sttTime);
        }
     }
   LastBid=Bid;

   if(t!=Time[0])
     {
      th=0;
      tl=0;
      sh=0;
      sl=0;
      t=Time[0];
      TickCount=0;
      tTick=0;
      ttTick=0;
      tTime=0;
      ttTime=0;
     }

   if(Bid>LastHigh) sh++;
   if(Bid<LastLow) sl++;

   if(Bid==high[0])
     {
      th++;
      LastHigh=high[0];
     }

   if(Bid==low[0])
     {
      tl++;
      LastLow=low[0];
     }

   PutLabel("L1",160,10,"Touch High: "+(string)th);
   PutLabel("L2",160,30,"Touch Low: "+(string)tl);

   PutLabel("L3",160,50,"Shift High: "+(string)sh);
   PutLabel("L4",160,70,"Shift Low: "+(string)sl);

   PutLabel("L5",160,90,"Tick Count: "+(string)TickCount);

   PutLabel("L6",160,110,"1/2 Tick Count: "+(string)tTick);
   PutLabel("L7",160,130,"2/2 Tick Count: "+(string)ttTick);

   PutLabel("L8",160,150,"1/2 Time: "+(string)tTime);
   PutLabel("L9",160,170,"2/2 Time: "+(string)ttTime);

//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+

avatar

AM2

  • 18 ноября 2016, 14:19
0
значение Shift High меняется даже при нахождении цены в нижней части бара

Этот момент корректно работает, смотрю дальше.
avatar

AM2

  • 18 ноября 2016, 14:11
0
Добавлю вечером.
avatar

AM2

  • 17 ноября 2016, 12:18