와드 №6 - 페이지 35

 
스탠드 - 적용하지 마십시오. 실수가 발견되었습니다. 지금 바로 수정하겠습니다
 
Dr.Drain :
커패시터를 넣을 때라고 생각합니까? :-)))

아니요, 너무 늦었습니다. 진단을 내릴 시간입니다.
 
//+------------------------------------------------------------------+
//|                                                _2_DoidsSheme.mq4 |
//|           Copyright © 2012. XrustSolution. mail:xrustx@gmail.com |
//|          https://www.youtube.com/user/opmlv http://forexrust.info |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2012. XrustSolution. mail:xrustx@gmail.com"
#property link      "https://www.youtube.com/user/opmlv http://forexrust.info"
//+------------------------------------------------------------------+
//| Super Global Variables                                           |
//+------------------------------------------------------------------+
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Red
//+------------------------------------------------------------------+
//| Extern Variables                                                 |
//+------------------------------------------------------------------+
extern string  ЕмкостьКонденсатора          = "= Начальный период МА";
extern    int  Capacity                                     = 50      ;
extern string  СопротивлениеУтечки                  = " конденсатора";
extern double  Resistance_C1                                = 100    ;
extern string  Резистор_В_Цепи_Заряда               = " конденсатора";
extern double  Resistance_R1                                = 0.13     ;
extern string  Резистор_В_Цепи_Разряда              = " конденсатора";
extern double  Resistance_R2                                = 0.1     ;
extern string  Порог_пробоя_Варистора               = "Максимальный период";
extern double  SafePerid                                    = 100    ;
extern string  МетодСбросаЗаряда                    = "true=Ограничение/false=Сброс на 0";
extern   bool  ResetMetod                                   = true   ;
extern    int  MoovingMetod                                 = 0      ;
extern    int  MoovingPrice                                 = 0      ;
//+------------------------------------------------------------------+
//|   Includes                                                                  |
//+------------------------------------------------------------------+
//#include <OBJECTS_CLASSES.mqh>
//#include <AlertsAndSounds.mqh>//GetInfo("");          
//+------------------------------------------------------------------+
//|   Defines & Global variavles                                     |
//+------------------------------------------------------------------+
#define empty  EMPTY_VALUE

//+------------------------------------------------------------------+
//--- buffers
double diods[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
void init(){
        //---- indicators
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,diods);
        //----
return;}
//+------------------------------------------------------------------+
void deinit(){return;}
//+------------------------------------------------------------------+
void start(){
        //----
                
        //----
        static int preLimit=0;
        static double prerp = 0;         
   int i, ii, x, y, counted = IndicatorCounted();
   if (counted > 0) counted--;
   int limit = Bars - counted;
   int per   = Period();
   string sy = Symbol();
   string txt="";
   double res=0,pres=0,diff=0,pdiff=0,koff=0;
   if(limit<=preLimit){limit=preLimit+1;}
        //----
   for(i=5000;i>=0;i--){
        res = iMA(sy,per,1,0,MoovingMetod,MoovingPrice,i);
        diff =  MathAbs(res-iMA(sy,per,1,0,MoovingMetod,MoovingPrice,i+1));
        if(diff > pdiff){
          koff-=MathAbs(diff-pdiff)/Resistance_R1;
        }else
        if(diff < pdiff){
          koff+=MathAbs(diff-pdiff)/Resistance_R2;
        }
        koff-=1/Resistance_C1;          
        
        pdiff=diff;
        if(koff>SafePerid){
          if(ResetMetod){
             koff = koff-SafePerid;
          }else{
             koff = 0;
          }   
        }
        if(koff<-(Capacity-1)){koff=-Capacity+1;}
        if(Capacity+koff>preLimit){preLimit = Capacity+koff;}
        diods[i] = iMA(sy,per,Capacity+koff,0,MoovingMetod,MoovingPrice,i+1);
   }
   
        //----
return;}
//+------------------------------------------------------------------+
 
C-4 :

아니요, 너무 늦었습니다. 진단을 내릴 시간입니다.

즐겨 보자 :)
 
FAQ:
mashkoobrazny 표시기가 있습니다.
 
//+------------------------------------------------------------------+
//|                                                _2_DoidsSheme.mq4 |
//|           Copyright © 2012. XrustSolution. mail:xrustx@gmail.com |
//|          https://www.youtube.com/user/opmlv http://forexrust.info |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2012. XrustSolution. mail:xrustx@gmail.com"
#property link       "https://www.youtube.com/user/opmlv http://forexrust.info"
//+------------------------------------------------------------------+
//| Super Global Variables                                           |
//+------------------------------------------------------------------+
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Blue
//+------------------------------------------------------------------+
//| Extern Variables                                                 |
//+------------------------------------------------------------------+
extern string   ЕмкостьКонденсатора          = "= Начальный период МА" ;
extern      int   Capacity                                     = 50       ;
extern string   СопротивлениеУтечки                  = " конденсатора" ;
extern double   Resistance_C1                                = 100     ;
extern string   Резистор_В_Цепи_Заряда               = " конденсатора" ;
extern double   Resistance_R1                                = 0.3      ;
extern string   Резистор_В_Цепи_Разряда              = " конденсатора" ;
extern double   Resistance_R2                                = 0.1      ;
extern string   Порог_пробоя_Варистора               = "Максимальный период" ;
extern double   SafePerid                                    = 100     ;
extern string   МетодСбросаЗаряда                    = "true=Ограничение/false=Сброс на 0" ;
extern    bool   ResetMetod                                   = true   ;
extern      int   MoovingMetod                                 = 0       ;
extern      int   MoovingPrice                                 = 0       ;
//+------------------------------------------------------------------+
//|   Includes                                                                  |
//+------------------------------------------------------------------+
//#include <OBJECTS_CLASSES.mqh>
//#include <AlertsAndSounds.mqh>//GetInfo("");          
//+------------------------------------------------------------------+
//|   Defines & Global variavles                                     |
//+------------------------------------------------------------------+
#define empty  EMPTY_VALUE

//+------------------------------------------------------------------+
//--- buffers
double diods[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
void init(){
         //---- indicators
   SetIndexStyle ( 0 , DRAW_LINE );
   SetIndexBuffer ( 0 ,diods);
         //----
return ;}
//+------------------------------------------------------------------+
void deinit(){ return ;}
//+------------------------------------------------------------------+
void start(){
         //----
                
         //----
         static int preLimit= 0 ;
         static double prerp = 0 ;         
   int i, ii, x, y, counted = IndicatorCounted ();
   if (counted > 0 ) counted--;
   int limit = Bars - counted;
   int per   = Period ();
   string sy = Symbol ();
   string txt= "" ;
   double res= 0 ,pres= 0 ,diff= 0 ,pdiff= 0 ,koff= 0 ;
   if (limit<=preLimit){limit=preLimit+ 1 ;}
         //----
   for (i= 5000 ;i>= 0 ;i--){
        res = iMA (sy,per,Capacity+koff, 0 ,MoovingMetod,MoovingPrice,i);
        diff =   MathAbs (res- iMA (sy,per,Capacity+koff, 0 ,MoovingMetod,MoovingPrice,i+ 1 ));
         if (diff > pdiff){
          koff-= MathAbs (diff-pdiff)/Resistance_R1;
        } else
         if (diff < pdiff){
          koff+= MathAbs (diff-pdiff)/Resistance_R2;
        }
        koff-= 1 /Resistance_C1;          
        
        pdiff=diff;
         if (koff>SafePerid){
           if (ResetMetod){
             koff = koff-SafePerid;
          } else {
             koff = 0 ;
          }   
        }
         if (koff<-(Capacity- 1 )){koff=-Capacity+ 1 ;}
         if (Capacity+koff>preLimit){preLimit = Capacity+koff;}
        diods[i] = iMA (sy,per,Capacity+koff, 0 ,MoovingMetod,MoovingPrice,i+ 1 );
   }
   
         //----
return ;}
//+------------------------------------------------------------------+

피드백과 함께

 
DmitriyN :
mashkoobrazny 표시기가 있습니다.

그에게 무엇을 기대했습니까?
 
FAQ :
들어봐, Rustam, 어떤 스키마라도 MQL 코드로 바꿀 수 있니? 나는 유머가 아니라 진지하게 묻는 것입니다.
 

MQL => 스키마: 질문 없음

Scheme =>MQL : 언어의 수학 장치가 허용하는 한.

첫 번째 경우 현재, 하드웨어에서 수행하도록 요청하지 마십시오. 너무 게으릅니다. :))

 
... 흠. 첫 번째 옵션은 여전히 파기(시장의 현실에 맞게 조정)이며 데이터베이스로 보낼 수 있습니다. 좋은 적응형 Mashka가 나타났습니다.