通过网盘分享的文件:! Follow the line – avgs (mtf + arrows + alerts + btn).ex4

链接: https://pan.baidu.com/s/1Z2xh6M6a432e4sH5YJhHkg?pwd=vxsn 提取码: vxsn 复制这段内容后打开百度网盘手机App,操作更方便哦



//---- input parameters 

extern bool Show.Labels = true ;
extern bool Show.Gauge  = true ;

extern bool Show.Proj   = true ;

extern double    myUpper      = 0 ; 
extern double    myLower      = 0 ;
extern double    myWindow     = 0.77 ;
extern int       myBars       = 21 ;
extern int       myShift      = 1 ;

extern int myChartY = 200 ;
extern bool Horizontal = true ;


extern int myPctHi = 66 ;
extern int myPctLo = 34 ;

extern color myPctHiColor = Red ; 
extern color myPctMidColor = DimGray ; 
extern color myPctLoColor = Blue ; 

extern color myProjColor = Magenta ; 


extern int myHighMark = 225 ; // 218 = dn arrowhead, 242 = dn arrow, 226, 233 dn arrow solid, 201, 202 dn arrow twist 
extern int myLowMark  = 225 ; // 217 = up arrowhead, 241 = up arrow, 225, 233 up arrow solid, 199, 200 up arrow twist 
extern int myBackMark = 225 ;


extern color ColorHeading = DimGray;
extern color ColorUpper = Red ;
extern color ColorShort = Crimson ;
extern color ColorLong  = Green ;
extern color ColorLower = Blue ;

//---- buffers


int i;
  
double R1, R2, R3 ;  

double X05 ;
double X06 ;   
double X07 ;
double X08, XRN ; 
double xRet ;
double xRetPct;    
  
string tChartPeriod ; 

string tLabel01, tLabel02, tLabel03, tLabel04, tLabel05, tLabel06, tLabel07  ;   
string tRes0 = "hhRes_0" ;
string tSup0 = "hhSup_0" ;
string tFib1 = "hhFib1_0" ;
string tFib2 = "hhFib2_0" ;

string tResP = "hhRes_P" ;
string tSupP = "hhSup_P" ;

double range , point ;
double DynR; 
double DynS;  
datetime StartTime;
int digits2, digits ;

double Entry, work, goShort, goLong, reward, risk, ratio, Pct, ResP, SupP  ;

bool xAutoCalc = false;
int nHH, nLL; 
string tPIVOT0 ="fgres" ;
string tPIVOT1 ="fgsup" ; 
string tPIVOT2 ="fgslo" ;
string shortName, OBJ001, OBJ002,OBJ003,OBJ004,OBJ005,OBJ006,OBJ007,OBJ008,OBJ009;
string OBJ010, OBJ011, OBJ012,OBJ013,OBJ014,OBJ015,OBJ016,OBJ017,OBJ018,OBJ019;
string OBJ020, OBJ021, OBJ022,OBJ023,OBJ024,OBJ025,OBJ026,OBJ027,OBJ028,OBJ029;

color colorPct ;

//+------------------------------------------------------------------+
   
int init()
  {

    deinit() ;

  shortName  = MakeUniqueName("srhl ","") + myBars ;
  tChartPeriod =  TimeFrameToString(Period()) ;
  IndicatorShortName(shortName);
  
  tLabel01 = shortName +  "1Resistance" + tChartPeriod ;
  tLabel02 = shortName + "2Support" + tChartPeriod ;
  tLabel03 = shortName + "3Short" + tChartPeriod ; 
  tLabel04 = shortName + "4Long" + tChartPeriod ;

   tResP = shortName + "Res_P" ;
   tSupP = shortName + "Sup_P" ;

   tRes0 = shortName + "Res_0" ;
   tSup0 = shortName + "Sup_0" ;
   tFib1 = shortName + "Fib1_0" ;
   tFib2 = shortName + "Fib2_0" ;

 tPIVOT0 = shortName + "fgres" ;
 tPIVOT1 = shortName + "fgsup" ; 
 tPIVOT2 = shortName + "fgslo" ;


  OBJ001 = shortName + "001" ;
  OBJ002 = shortName + "002" ;
  OBJ003 = shortName + "003" ;
  OBJ004 = shortName + "004" ;
  OBJ005 = shortName + "005" ;
  OBJ006 = shortName + "006" ;
  OBJ007 = shortName + "007" ;
  OBJ008 = shortName + "008" ;
  OBJ009 = shortName + "009" ;
  OBJ010 = shortName + "010" ;
  OBJ011 = shortName + "0011" ;
  OBJ012 = shortName + "0012" ;
  OBJ013 = shortName + "0013" ;
  OBJ014 = shortName + "0014" ;
  OBJ015 = shortName + "0015" ;
  OBJ016 = shortName + "0016" ;
  OBJ017 = shortName + "0017" ;
  OBJ018 = shortName + "0018" ;
  OBJ019 = shortName + "0019" ;
  OBJ020 = shortName + "0020" ;
  OBJ021 = shortName + "0021" ;
  OBJ022 = shortName + "0022" ;
  OBJ023 = shortName + "0023" ;
  OBJ024 = shortName + "0024" ;  
  
  digits = Digits ;
  point  = Point ;   


   if(digits == 5 || digits == 3) { digits2 = 0 ; point = point * 10 ; } else { digits2 = 0 ; }
  
  if( myUpper == 0 ) { xAutoCalc = true ; }   
      
 work    = ( myUpper  - myLower ) * myWindow  ; 
   
 goShort = myLower  + work   ;
 goLong  = myUpper  - work   ;
 

 reward   = myUpper - goLong ;
 risk     = goLong - myLower ;
 ratio    = reward / risk ;
 range    = ( myUpper  - myLower ) / point ;




   return(0);
  }

  
//+------------------------------------------------------------------+

void ObDeleteObjectsByPrefix(string Prefix)
  {
   int L = StringLen(Prefix);
   int i = 0; 
   while(i < ObjectsTotal())
     {
       string ObjName = ObjectName(i);
       if(StringSubstr(ObjName, 0, L) != Prefix) 
         { 
           i++; 
           continue;
         }
       ObjectDelete(ObjName);
     }
  }
  
//+------------------------------------------------------------------+
int deinit()
{
   ObDeleteObjectsByPrefix("sr");   
/*  
   ObjectsDeleteAll( 0, OBJ_FIBO ) ;
   ObjectDelete(tPIVOT0);
   ObjectDelete(tPIVOT1); 
   ObjectDelete(tPIVOT2);      
   ObjectDelete(OBJ001);
   ObjectDelete(OBJ002);
   ObjectDelete(OBJ003);
   ObjectDelete(OBJ004);  
   ObjectDelete(OBJ005); 
   ObjectDelete(OBJ006);
   ObjectDelete(OBJ007);
   ObjectDelete(OBJ008);
   ObjectDelete(OBJ009);
   ObjectDelete(OBJ010);
   ObjectDelete( OBJ021 );
   ObjectDelete(  OBJ020 );   
   ObjectDelete(  OBJ019 );
   ObjectDelete(  OBJ018 );
   ObjectDelete(  OBJ017 );
   ObjectDelete(  OBJ016 );
   ObjectDelete(  OBJ015 );
   ObjectDelete( OBJ011 );
   ObjectDelete(OBJ013);      
   ObjectDelete(OBJ013);           
   ObjectDelete(OBJ014); 
   ObjectDelete(OBJ022);  
   ObjectDelete(OBJ023);           
   ObjectDelete(OBJ024);
   ObjectDelete(tRes0);           
   ObjectDelete(tSup0);
   ObjectDelete(tResP);           
   ObjectDelete(tSupP);
   
*/      
   return(0);
  }

//+------------------------------------------------------------------+ 

int start()
{

if( xAutoCalc == true ) DoWork() ;  

if( Show.Labels) DoShowLabels() ;

if( Show.Gauge ) DoShowGauge() ;

if( Show.Proj ) DoShowProj() ; 
 

作者 admin

九稳量化交易系统 是一套高胜率策略趋势跟踪系统,系统最大优势就是开仓位置精确,信号不漂移 不延迟 同步行情信号 拒绝马后面!www.gao998.cn 微信 fxfx668998

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注