客服热线:18391752892

一段可用的程序代码

   日期:2019-01-12     浏览:231    
马上注册,结交更多好友,下载更多资源

您需要 登录 才可以下载或查看,没有帐号?注册 本帖最后由 yuanrongjei 于 2016-11-25 23:32 编辑
#property indicator_separate_window
extern double Risk_to_Reward_ratio = 3.0;
extern int First_av = 5;
extern int Second_av = 10;
extern int Third_av = 20;
int nDigits;
int init()
{
IndicatorShortName( TSR
   if(Symbol()== GBPJPY || Symbol()== EURJPY || Symbol()== USDJPY || Symbol()== GOLD || Symbol()== USDMXN ) nDigits = 2;
   if(Symbol()== GBPUSD || Symbol()== EURUSD || Symbol()== NZDUSD || Symbol()== USDCHF  ||
   Symbol()== USDCAD || Symbol()== AUDUSD || Symbol()== EURUSD || Symbol()== EURCHF  || Symbol()== EURGBP
   || Symbol()== EURCAD || Symbol()== EURAUD )nDigits = 4;
   return(0);
}
int deinit()
 {
   return(0);
 }
int start()
 {
int R1=0,R5=0,R10=0,R20=0,RAvg=0;
   int RoomUp=0,RoomDown=0,StopLoss_Long=0,StopLoss_Short=0;
   double   SL_Long=0,SL_Short=0;
   double   low0=0,high0=0;
   string   Text=
   int i=0;
   R1 = (iHigh(NULL,PERIOD_D1,1)-iLow(NULL,PERIOD_D1,1))/Point;
   for(i=1;i =First_av;i++)
     R5    =    R5 + (iHigh(NULL,PERIOD_D1,i)-iLow(NULL,PERIOD_D1,i))/Point;
   for(i=1;i =Second_av;i++)
     R10   =    R10 + (iHigh(NULL,PERIOD_D1,i)-iLow(NULL,PERIOD_D1,i))/Point;
   for(i=1;i =Third_av;i++)
     R20   =    R20 + (iHigh(NULL,PERIOD_D1,i)-iLow(NULL,PERIOD_D1,i))/Point;
   R5 = R5/First_av;
   R10 = R10/Second_av;
   R20 = R20/Third_av;
   RAvg = (R1+R5+R10+R20)/2; //RAvg = (R5+R10+R20)/3;new setting   
   low0 = iLow(NULL,PERIOD_D1,0);
   high0 = iHigh(NULL,PERIOD_D1,0);
   RoomUp   = RAvg - (Bid - low0)/Point;
   RoomDown = RAvg - (high0 - Bid)/Point;
   StopLoss_Long = RoomUp/Risk_to_Reward_ratio;
   SL_Long     = Bid - StopLoss_Long*Point;
   StopLoss_Short = RoomDown/Risk_to_Reward_ratio;
   SL_Short      = Bid + StopLoss_Short*Point;
          double aa1,aa2; //输入最高点位,最低点位
aa2= SL_Long;
aa1=SL_Short;
 double aa3,aa4,aa5,aa6,aa7;
aa3=aa1-(aa1+aa2)/4;//计算线差点位
aa4=aa1-(aa1+aa2)/2;//计算平行点位
aa5=aa1+aa4;//多单回调空单买入平行线高点上方
aa6=aa2-aa4;//空单回调多单买入平行线低点下单
 
     
   
     
       ObjectCreate( TSR5 , OBJ_LABEL, WindowFind( TSR ), 0, 0);
     ObjectSetText( TSR5 , 回调做空 , 20, Arial Bold , CadetBlue);
     ObjectSet( TSR5 , OBJPROP_CORNER, 0);
     ObjectSet( TSR5 , OBJPROP_XDISTANCE, 290);
     ObjectSet( TSR5 , OBJPROP_YDISTANCE, 20);
     ObjectCreate( TSR6 , OBJ_LABEL, WindowFind( TSR ), 0, 0);
     ObjectSetText( TSR6 ,DoubleToStr(aa5 ,3),20, Arial Bold , Orange);
     ObjectSet( TSR6 , OBJPROP_CORNER, 0);
     ObjectSet( TSR6 , OBJPROP_XDISTANCE, 290);
     ObjectSet( TSR6 , OBJPROP_YDISTANCE, 60);
     
       ObjectCreate( TSR7 , OBJ_LABEL, WindowFind( TSR ), 0, 0);
     ObjectSetText( TSR7 , 回调做多 , 20, Arial Bold , CadetBlue);
     ObjectSet( TSR7 , OBJPROP_CORNER, 0);
     ObjectSet( TSR7 , OBJPROP_XDISTANCE, 420);
     ObjectSet( TSR7 , OBJPROP_YDISTANCE, 20);
     ObjectCreate( TSR8 , OBJ_LABEL, WindowFind( TSR ), 0, 0);
     ObjectSetText( TSR8 ,DoubleToStr(aa6 ,3),20, Arial Bold , Orange);
     ObjectSet( TSR8 , OBJPROP_CORNER, 0);
     ObjectSet( TSR8 , OBJPROP_XDISTANCE, 420);
     ObjectSet( TSR8 , OBJPROP_YDISTANCE, 60);
     
       ObjectCreate( TSR9 , OBJ_LABEL, WindowFind( TSR ), 0, 0);
     ObjectSetText( TSR9 , 止损点位 , 20, Arial Bold , CadetBlue);
     ObjectSet( TSR9 , OBJPROP_CORNER, 0);
     ObjectSet( TSR9 , OBJPROP_XDISTANCE, 550);
     ObjectSet( TSR9 , OBJPROP_YDISTANCE, 20);
     ObjectCreate( TSR10 , OBJ_LABEL, WindowFind( TSR ), 0, 0);
     ObjectSetText( TSR10 ,DoubleToStr(aa3/100+2 ,3),20, Arial Bold , Red);
     ObjectSet( TSR10 , OBJPROP_CORNER, 0);
     ObjectSet( TSR10 , OBJPROP_XDISTANCE, 575);
     ObjectSet( TSR10 , OBJPROP_YDISTANCE, 60);
     
       ObjectCreate( TSR11 , OBJ_LABEL, WindowFind( TSR ), 0, 0);
     ObjectSetText( TSR11 , 止赢目标 , 20, Arial Bold , CadetBlue);
     ObjectSet( TSR11 , OBJPROP_CORNER, 0);
     ObjectSet( TSR11 , OBJPROP_XDISTANCE, 680);
     ObjectSet( TSR11 , OBJPROP_YDISTANCE, 20);
     ObjectCreate( TSR12 , OBJ_LABEL, WindowFind( TSR ), 0, 0);
     ObjectSetText( TSR12 ,DoubleToStr(aa4*2 ,2),20, Arial Bold , Blue);
     ObjectSet( TSR12 , OBJPROP_CORNER, 0);
     ObjectSet( TSR12 , OBJPROP_XDISTANCE, 698);
     ObjectSet( TSR12 , OBJPROP_YDISTANCE, 60);
     
       ObjectCreate( TSR13 , OBJ_LABEL, WindowFind( TSR ), 0, 0);
     ObjectSetText( TSR13 , 顺势多单 , 20, Arial Bold , CadetBlue);
     ObjectSet( TSR13 , OBJPROP_CORNER, 0);
     ObjectSet( TSR13 , OBJPROP_XDISTANCE, 815);
     ObjectSet( TSR13 , OBJPROP_YDISTANCE, 20);
     ObjectCreate( TSR14 , OBJ_LABEL, WindowFind( TSR ), 0, 0);
     ObjectSetText( TSR14 ,DoubleToStr(aa1-aa4+3.50 ,3),20, Arial Bold , Orange);
     ObjectSet( TSR14 , OBJPROP_CORNER, 0);
     ObjectSet( TSR14 , OBJPROP_XDISTANCE, 815);
     ObjectSet( TSR14 , OBJPROP_YDISTANCE, 60);
     
     
       ObjectCreate( TSR15 , OBJ_LABEL, WindowFind( TSR ), 0, 0);
     ObjectSetText( TSR15 , 顺势空单 , 20, Arial Bold , CadetBlue);
     ObjectSet( TSR15 , OBJPROP_CORNER, 0);
     ObjectSet( TSR15 , OBJPROP_XDISTANCE, 955);
     ObjectSet( TSR15 , OBJPROP_YDISTANCE, 20);
     ObjectCreate( TSR16 , OBJ_LABEL, WindowFind( TSR ), 0, 0);
     ObjectSetText( TSR16 ,DoubleToStr(aa1-aa4-3.50 ,3),20, Arial Bold , Orange);
     ObjectSet( TSR16 , OBJPROP_CORNER, 0);
     ObjectSet( TSR16 , OBJPROP_XDISTANCE, 955);
     ObjectSet( TSR16 , OBJPROP_YDISTANCE, 60);
     return(0);
 }

有个朋友偷偷告诉我说前段时间关注了微/信公众号“奇迈宝”,学会了5天盈利50%的方法,也不知道是不是真的,哪位大虾帮我鉴定一下啊,感谢感谢!
外汇交易有很大的风险性,本站所有资源均来自网络,请选择使用,如若出现亏损,本站不承担任何责任!


特别提示:本信息由相关企业自行提供,真实性未证实,仅供参考。请谨慎采用,风险自负。


0相关评论
相关行情
推荐行情
点击排行