交易危机

 找回密码
 快捷注册(禁q号)

QQ登录

只需一步,快速开始

搜索
广告位
查看: 21228|回复: 70
打印 上一主题 下一主题

[其他] bmans_renko-system,一个国外论坛的系统

  [复制链接]

14

主题

829

积分

1

精华

初级操盘手

金钱
829 美元
权重
36
跳转到指定楼层
楼主
发表于 2014-3-19 21:35 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
这个系统是某个群里的一个前辈分享,个人在使用这个系统进行复盘统计后感觉这个系统还是不错的,现分享给大家。大家看着给点分哈{:soso_e102:} 效果图如下


PS:由于这个系统用的周期很小,个人把这个系统的使用周期扩大到日图以符合个人习惯,发现效果也不错,大家可以根据自己的习惯进行更改。另外renko技术个人感觉很实用,有兴趣的话可以在这个国外论坛里去找找相关的说明。网页在附件里。
asi代码:

  1. //+------------------------------------------------------------------+
  2. //|                                                          ASI.mq4 |
  3. //|                      Copyright ?2007, MetaQuotes Software Corp. |
  4. //+------------------------------------------------------------------+
  5. #property copyright "Copyright ?2007, MetaQuotes Software Corp."
  6. //----
  7. #property indicator_separate_window
  8. #property indicator_buffers 1
  9. #property indicator_color1 DarkBlue
  10. //---- input parameters
  11. extern double T = 300.0;
  12. //---- buffers
  13. double ExtMapBuffer1[];
  14. double SIBuffer[];
  15. //+------------------------------------------------------------------+
  16. //| Custom indicator initialization function                         |
  17. //+------------------------------------------------------------------+
  18. int init()
  19.   {
  20. //---- indicators
  21.    IndicatorBuffers(2);
  22.    SetIndexStyle(0, DRAW_LINE);
  23.    SetIndexBuffer(0, ExtMapBuffer1);
  24.    SetIndexLabel(0, "Accumulation Swing Index");
  25.    SetIndexBuffer(1, SIBuffer);
  26.    SetIndexEmptyValue(0, 0.0);
  27.    SetIndexEmptyValue(1, 0.0);
  28. //----
  29.    return(0);
  30.   }
  31. //+------------------------------------------------------------------+
  32. //| Custom indicator deinitialization function                       |
  33. //+------------------------------------------------------------------+
  34. int deinit()
  35.   {
  36. //----
  37.    return(0);
  38.   }
  39. //+------------------------------------------------------------------+
  40. //| Custom indicator iteration function                              |
  41. //+------------------------------------------------------------------+
  42. int start()
  43.   {
  44.    int counted_bars = IndicatorCounted();
  45. //----
  46.    int i, limit;
  47.    double R, K, TR, ER, SH, Tpoints;
  48.    if(counted_bars == 0)
  49.        limit = Bars - 1;
  50.    if(counted_bars > 0)
  51.        limit = Bars - counted_bars;
  52.    Tpoints = T*MarketInfo(Symbol(), MODE_POINT);
  53.    for(i = limit; i >= 0; i--)
  54.      {
  55.        TR = iATR(Symbol(), 0, 1, i);
  56.        if(Close[i+1] >= Low[i] && Close[i+1] <= High[i])
  57.            ER = 0;
  58.        else
  59.          {
  60.            if(Close[i+1] > High[i])
  61.                ER = MathAbs(High[i] - Close[i+1]);
  62.            if(Close[i+1] < Low[i])
  63.                ER = MathAbs(Low[i] - Close[i+1]);
  64.          }
  65.        K = MathMax(MathAbs(High[i] - Close[i+1]), MathAbs(Low[i] - Close[i+1]));
  66.        SH = MathAbs(Close[i+1] - Open[i+1]);
  67.        R = TR - 0.5*ER + 0.25*SH;
  68.        if(R == 0)
  69.            SIBuffer[i] = 0;
  70.        else
  71.            SIBuffer[i] = 50*(Close[i] - Close[i+1] + 0.5*(Close[i] - Open[i]) +
  72.                          0.25*(Close[i+1] - Open[i+1]))*(K / Tpoints) / R;
  73.        ExtMapBuffer1[i] = ExtMapBuffer1[i+1] + SIBuffer[i];
  74.      }
  75. //----
  76.    return(0);
  77.   }
  78. //+------------------------------------------------------------------+
复制代码

nonlagMA代码:

  1. //+------------------------------------------------------------------+
  2. //|                                                  NonLagMA_v7.mq4 |
  3. //|                                Copyright ?2006, TrendLaboratory |
  4. //+------------------------------------------------------------------+
  5. #property copyright "Copyright ?2006, TrendLaboratory"
  6. #property indicator_chart_window
  7. #property indicator_buffers 3
  8. #property indicator_color1 Yellow
  9. #property indicator_width1 2
  10. #property indicator_color2 Lime
  11. #property indicator_width2 2
  12. #property indicator_color3 Red
  13. #property indicator_width3 2
  14. //---- input parameters
  15. extern int     Price          = 0;  //Apply to Price(0-Close;1-Open;2-High;3-Low;4-Median price;5-Typical price;6-Weighted Close)
  16. extern int     Length         = 10;  //Period of NonLagMA
  17. extern int     Displace       = 0;  //DispLace or Shift
  18. extern double  PctFilter      = 0;  //Dynamic filter in decimal
  19. extern int     Color          = 1;  //Switch of Color mode (1-color)  
  20. extern int     ColorBarBack   = 1;  //Bar back for color mode
  21. extern double  Deviation      = 0;  //Up/down deviation        
  22. extern int     SoundAlertMode = 0;  //Sound Alert switch
  23. //---- indicator buffers
  24. double MABuffer[];
  25. double UpBuffer[];
  26. double DnBuffer[];
  27. double trend[];
  28. double Del[];
  29. double AvgDel[];
  30. double alfa[];
  31. int i, Phase, Len, Cycle=4;
  32. double Coeff, beta, t, Sum, Weight, g;
  33. double pi = 3.1415926535;   
  34. bool   UpTrendAlert=false, DownTrendAlert=false;
  35. //+------------------------------------------------------------------+
  36. //| Custom indicator initialization function                         |
  37. //+------------------------------------------------------------------+
  38.   int init()
  39.   {
  40.    IndicatorBuffers(6);
  41.    SetIndexStyle(0,DRAW_LINE);
  42.    SetIndexBuffer(0,MABuffer);
  43.    SetIndexStyle(1,DRAW_LINE);
  44.    SetIndexBuffer(1,UpBuffer);
  45.    SetIndexStyle(2,DRAW_LINE);
  46.    SetIndexBuffer(2,DnBuffer);
  47.    SetIndexBuffer(3,trend);
  48.    SetIndexBuffer(4,Del);
  49.    SetIndexBuffer(5,AvgDel);
  50.    string short_name;
  51. //---- indicator line
  52.    
  53.    IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS));
  54. //---- name for DataWindow and indicator subwindow label
  55.    short_name="NonLagMA("+Length+")";
  56.    IndicatorShortName(short_name);
  57.    SetIndexLabel(0,"NonLagMA");
  58.    SetIndexLabel(1,"Up");
  59.    SetIndexLabel(2,"Dn");
  60. //----
  61.    SetIndexShift(0,Displace);
  62.    SetIndexShift(1,Displace);
  63.    SetIndexShift(2,Displace);
  64.    
  65.    SetIndexEmptyValue(0,EMPTY_VALUE);
  66.    SetIndexEmptyValue(1,EMPTY_VALUE);
  67.    SetIndexEmptyValue(2,EMPTY_VALUE);
  68.    
  69.    SetIndexDrawBegin(0,Length*Cycle+Length+1);
  70.    SetIndexDrawBegin(1,Length*Cycle+Length+1);
  71.    SetIndexDrawBegin(2,Length*Cycle+Length+1);
  72. //----
  73.    
  74.    Coeff =  3*pi;
  75.    Phase = Length-1;
  76.    Len = Length*Cycle + Phase;  
  77.    ArrayResize(alfa,Len);
  78.    Weight=0;   
  79.       
  80.       for (i=0;i<Len-1;i++)
  81.       {
  82.       if (i<=Phase-1) t = 1.0*i/(Phase-1);
  83.       else t = 1.0 + (i-Phase+1)*(2.0*Cycle-1.0)/(Cycle*Length-1.0);
  84.       beta = MathCos(pi*t);
  85.       g = 1.0/(Coeff*t+1);   
  86.       if (t <= 0.5 ) g = 1;
  87.       alfa[i] = g * beta;
  88.       Weight += alfa[i];
  89.       }

  90.    return(0);
  91.   }
  92. //+------------------------------------------------------------------+
  93. //| NonLagMA_v7                                                      |
  94. //+------------------------------------------------------------------+
  95. int start()
  96. {
  97.    int    i,shift, counted_bars=IndicatorCounted(),limit;
  98.    double price;      
  99.    if ( counted_bars > 0 )  limit=Bars-counted_bars;
  100.    if ( counted_bars < 0 )  return(0);
  101.    if ( counted_bars ==0 )  limit=Bars-Len-1;
  102.    if ( counted_bars < 1 )
  103.    
  104.    for(i=1;i<Length*Cycle+Length;i++)
  105.    {
  106.    MABuffer[Bars-i]=0;   
  107.    UpBuffer[Bars-i]=0;  
  108.    DnBuffer[Bars-i]=0;  
  109.    }
  110.    
  111.    for(shift=limit;shift>=0;shift--)
  112.    {       
  113.       Sum = 0;
  114.       for (i=0;i<=Len-1;i++)
  115.            {
  116.       price = iMA(NULL,0,1,0,3,Price,i+shift);      
  117.       Sum += alfa[i]*price;
  118.       
  119.       }
  120.    
  121.         if (Weight > 0) MABuffer[shift] = (1.0+Deviation/100)*Sum/Weight;
  122.    
  123.       
  124.       if (PctFilter>0)
  125.       {
  126.       Del[shift] = MathAbs(MABuffer[shift] - MABuffer[shift+1]);
  127.    
  128.       double sumdel=0;
  129.       for (i=0;i<=Length-1;i++) sumdel = sumdel+Del[shift+i];
  130.       AvgDel[shift] = sumdel/Length;
  131.    
  132.       double sumpow = 0;
  133.       for (i=0;i<=Length-1;i++) sumpow+=MathPow(Del[shift+i]-AvgDel[shift+i],2);
  134.       double StdDev = MathSqrt(sumpow/Length);
  135.      
  136.       double Filter = PctFilter * StdDev;
  137.      
  138.       if( MathAbs(MABuffer[shift]-MABuffer[shift+1]) < Filter ) MABuffer[shift]=MABuffer[shift+1];
  139.       }
  140.       
  141.       if (Color>0)
  142.       {
  143.       trend[shift]=trend[shift+1];
  144.       if (MABuffer[shift]-MABuffer[shift+1] > Filter) trend[shift]= 1;
  145.       if (MABuffer[shift+1]-MABuffer[shift] > Filter) trend[shift]=-1;
  146.          if (trend[shift]>0)
  147.          {  
  148.          UpBuffer[shift] = MABuffer[shift];
  149.          if (trend[shift+ColorBarBack]<0) UpBuffer[shift+ColorBarBack]=MABuffer[shift+ColorBarBack];
  150.          DnBuffer[shift] = EMPTY_VALUE;
  151.          }
  152.          if (trend[shift]<0)
  153.          {
  154.          DnBuffer[shift] = MABuffer[shift];
  155.          if (trend[shift+ColorBarBack]>0) DnBuffer[shift+ColorBarBack]=MABuffer[shift+ColorBarBack];
  156.          UpBuffer[shift] = EMPTY_VALUE;
  157.          }
  158.       }
  159.    }
  160. //----------   
  161.    string Message;
  162.    
  163.    if ( trend[2]<0 && trend[1]>0 && Volume[0]>1 && !UpTrendAlert)
  164.         {
  165.         Message = " "+Symbol()+" M"+Period()+": Signal for BUY";
  166.         if ( SoundAlertMode>0 ) Alert (Message);
  167.         UpTrendAlert=true; DownTrendAlert=false;
  168.         }
  169.                    
  170.         if ( trend[2]>0 && trend[1]<0 && Volume[0]>1 && !DownTrendAlert)
  171.         {
  172.         Message = " "+Symbol()+" M"+Period()+": Signal for SELL";
  173.         if ( SoundAlertMode>0 ) Alert (Message);
  174.         DownTrendAlert=true; UpTrendAlert=false;
  175.         }                 
  176. //----
  177.         return(0);       
  178. }
复制代码

renkolivechart 代码:

  1. //+------------------------------------------------------------------+
  2. //|                                          RenkoLiveChart_v2.0.mq4 |
  3. //|          Inspired from Renco script by "e4" (renko_live_scr.mq4) |
  4. //|                                         Copyleft 2009 LastViking |
  5. //+------------------------------------------------------------------+
  6. #property copyright ""
  7. #property indicator_chart_window
  8. #property indicator_buffers 1
  9. //+------------------------------------------------------------------+
  10. #include <WinUser32.mqh>
  11. //+------------------------------------------------------------------+
  12. extern int BoxSize = 5;
  13. extern int BoxOffset = 0;
  14. extern int RenkoTimeFrame = 2;      // What time frame to use for the offline renko chart
  15. extern bool StrangeSymbolName = false;
  16. //+------------------------------------------------------------------+
  17. int HstHandle = -1;
  18. string SymbolName;
  19. //+------------------------------------------------------------------+
  20. void UpdateChartWindow() {
  21.         static int hwnd = 0;

  22.         if(hwnd == 0) {
  23.                 hwnd = WindowHandle(SymbolName, RenkoTimeFrame);
  24.                 if(hwnd != 0) Print("Chart window detected");
  25.         }
  26.         if(hwnd != 0) if(PostMessageA(hwnd, WM_COMMAND, 0x822c, 0) == 0) hwnd = 0;
  27.         //if(hwnd != 0) UpdateWindow(hwnd);
  28. }
  29. //+------------------------------------------------------------------+
  30. int start() {
  31.         static int LastFPos = 0;
  32.         static double BoxPoints, PrevLow, PrevHigh, PrevOpen, PrevClose, CurVolume, CurHigh, CurLow;
  33.         static datetime PrevTime;
  34.        
  35.         if(HstHandle < 0) {
  36.                 // Init
  37.                
  38.                 // Error checking       
  39.                 if(!IsConnected()) {
  40.                         Print("Waiting for connection...");
  41.                         return(0);
  42.                 }                                                       
  43.                 if(!IsDllsAllowed()) {
  44.                         Print("Error: Dll calls must be allowed!");
  45.                         return(-1);
  46.                 }               
  47.                 if(MathAbs(BoxOffset) >= BoxSize) {
  48.                         Print("Error: |BoxOffset| should be less then BoxSize!");
  49.                         return(-1);
  50.                 }
  51.                 switch(RenkoTimeFrame) {
  52.                 case 1: case 5: case 15: case 30: case 60: case 240:
  53.                 case 1440: case 10080: case 43200: case 0:
  54.                         Print("Error: Invald time frame used for offline renko chart (RenkoTimeFrame)!");
  55.                         return(-1);
  56.                 }
  57.                 //
  58.                
  59.                 if(StrangeSymbolName) SymbolName = StringSubstr(Symbol(), 0, 6);
  60.                 else SymbolName = Symbol();
  61.                    BoxPoints = NormalizeDouble(BoxSize*Point, Digits);
  62.                    PrevLow = NormalizeDouble(BoxOffset*Point + MathFloor(Close[Bars-1]/BoxPoints)*BoxPoints, Digits);
  63.                    PrevHigh = PrevLow + BoxPoints;
  64.                    PrevOpen = PrevLow;
  65.                    PrevClose = PrevHigh;
  66.                 CurVolume = 1;
  67.                 PrevTime = Time[Bars-1];
  68.        
  69.                 // create / open hst file               
  70.                    HstHandle = FileOpenHistory(SymbolName + RenkoTimeFrame + ".hst", FILE_BIN|FILE_WRITE);
  71.                    if(HstHandle < 0) return(-1);
  72.                    //
  73.           
  74.                 // write hst file header
  75.                 int HstUnused[13];
  76.                    FileWriteInteger(HstHandle, 400, LONG_VALUE);                         // Version
  77.                    FileWriteString(HstHandle, "", 64);                                        // Copyright
  78.                    FileWriteString(HstHandle, SymbolName, 12);                        // Symbol
  79.                    FileWriteInteger(HstHandle, RenkoTimeFrame, LONG_VALUE);        // Period
  80.                    FileWriteInteger(HstHandle, Digits, LONG_VALUE);                // Digits
  81.                    FileWriteInteger(HstHandle, 0, LONG_VALUE);                        // Time Sign
  82.                    FileWriteInteger(HstHandle, 0, LONG_VALUE);                        // Last Sync
  83.                    FileWriteArray(HstHandle, HstUnused, 0, 13);                        // Unused
  84.                    //
  85.           
  86.                 // process historical data
  87.                   int i = Bars-2;
  88.                   while(i >= 0) {
  89.                  
  90.                         CurVolume = CurVolume + Volume[i];
  91.                
  92.                         if(LastFPos != 0) {
  93.                                 FileSeek(HstHandle, LastFPos, SEEK_SET);
  94.                                 FileWriteDouble(HstHandle, CurVolume, DOUBLE_VALUE);       
  95.                         }
  96.                
  97.                         bool UpTrend = High[i]+Low[i] > PrevHigh+PrevLow;
  98.                         // update low before high or the revers depending on is closest to prev. renko bar
  99.                
  100.                         while(UpTrend && Low[i] <= PrevLow-BoxPoints) {
  101.                                   PrevHigh = PrevHigh - BoxPoints;
  102.                                   PrevLow = PrevLow - BoxPoints;
  103.                                   PrevOpen = PrevHigh;
  104.                                   PrevClose = PrevLow;
  105.                                   CurVolume = 1;
  106.                                                            
  107.                                 FileWriteInteger(HstHandle, PrevTime, LONG_VALUE);
  108.                                 FileWriteDouble(HstHandle, PrevOpen, DOUBLE_VALUE);
  109.                                 FileWriteDouble(HstHandle, PrevLow, DOUBLE_VALUE);
  110.                                 FileWriteDouble(HstHandle, PrevHigh, DOUBLE_VALUE);
  111.                                 FileWriteDouble(HstHandle, PrevClose, DOUBLE_VALUE);
  112.                                   LastFPos = FileTell(HstHandle);   // Remeber Last pos in file                       
  113.                                 FileWriteDouble(HstHandle, CurVolume, DOUBLE_VALUE);
  114.                                
  115.                                 if(PrevTime < Time[i]) PrevTime = Time[i];
  116.                                 else PrevTime++;
  117.                         }
  118.                
  119.                         while(High[i] >= PrevHigh+BoxPoints) {
  120.                                   PrevHigh = PrevHigh + BoxPoints;
  121.                                   PrevLow = PrevLow + BoxPoints;
  122.                                   PrevOpen = PrevLow;
  123.                                   PrevClose = PrevHigh;
  124.                                   CurVolume = 1;
  125.                          
  126.                                 FileWriteInteger(HstHandle, PrevTime, LONG_VALUE);
  127.                                 FileWriteDouble(HstHandle, PrevOpen, DOUBLE_VALUE);
  128.                                 FileWriteDouble(HstHandle, PrevLow, DOUBLE_VALUE);
  129.                                 FileWriteDouble(HstHandle, PrevHigh, DOUBLE_VALUE);
  130.                                 FileWriteDouble(HstHandle, PrevClose, DOUBLE_VALUE);
  131.                                   LastFPos = FileTell(HstHandle);   // Remeber Last pos in file                       
  132.                                 FileWriteDouble(HstHandle, CurVolume, DOUBLE_VALUE);
  133.                                
  134.                                 if(PrevTime < Time[i]) PrevTime = Time[i];
  135.                                 else PrevTime++;
  136.                         }
  137.                
  138.                           while(!UpTrend && Low[i] <= PrevLow-BoxPoints) {
  139.                                   PrevHigh = PrevHigh - BoxPoints;
  140.                                   PrevLow = PrevLow - BoxPoints;
  141.                                   PrevOpen = PrevHigh;
  142.                                   PrevClose = PrevLow;
  143.                                   CurVolume = 1;
  144.                          
  145.                                 FileWriteInteger(HstHandle, PrevTime, LONG_VALUE);
  146.                                 FileWriteDouble(HstHandle, PrevOpen, DOUBLE_VALUE);
  147.                                 FileWriteDouble(HstHandle, PrevLow, DOUBLE_VALUE);
  148.                                 FileWriteDouble(HstHandle, PrevHigh, DOUBLE_VALUE);
  149.                                 FileWriteDouble(HstHandle, PrevClose, DOUBLE_VALUE);
  150.                                   LastFPos = FileTell(HstHandle);   // Remeber Last pos in file                       
  151.                                 FileWriteDouble(HstHandle, CurVolume, DOUBLE_VALUE);
  152.                                
  153.                                 if(PrevTime < Time[i]) PrevTime = Time[i];
  154.                                 else PrevTime++;
  155.                         }               
  156.                         i--;
  157.                 }
  158.                 FileFlush(HstHandle);
  159.                 //
  160.                        
  161.                 Comment("RenkoLiveChart(" + BoxSize + "): Open Offline ", SymbolName, ",M", RenkoTimeFrame, " to view chart");
  162.                
  163.                 if(PrevClose == PrevHigh) {
  164.                         CurHigh = PrevHigh;
  165.                         CurLow = PrevHigh;
  166.                 } else { // PrevClose == PrevLow
  167.                         CurHigh = PrevLow;
  168.                         CurLow = PrevLow;
  169.                 }
  170.                 CurVolume = 0;
  171.                
  172.                 UpdateChartWindow();
  173.                
  174.                 return(0);
  175.                 // End historical data / Init               
  176.         }                
  177.        
  178.         // Begin live data feed                                          
  179.            if(Bid >= PrevHigh+BoxPoints) {
  180.                           
  181.                 CurVolume++;                          
  182.                 FileSeek(HstHandle, LastFPos, SEEK_SET);
  183.                 FileWriteDouble(HstHandle, CurVolume, DOUBLE_VALUE);                          
  184.                           
  185.                      PrevHigh = PrevHigh + BoxPoints;
  186.                 PrevLow = PrevLow + BoxPoints;
  187.                   PrevOpen = PrevLow;
  188.                   PrevClose = PrevHigh;
  189.                                                            
  190.                 FileWriteInteger(HstHandle, PrevTime, LONG_VALUE);
  191.                 FileWriteDouble(HstHandle, PrevOpen, DOUBLE_VALUE);
  192.                 FileWriteDouble(HstHandle, PrevLow, DOUBLE_VALUE);
  193.                 FileWriteDouble(HstHandle, PrevHigh, DOUBLE_VALUE);
  194.                 FileWriteDouble(HstHandle, PrevClose, DOUBLE_VALUE);
  195.                     LastFPos = FileTell(HstHandle);   // Remeber Last pos in file                                                                                         
  196.                 FileWriteDouble(HstHandle, 1, DOUBLE_VALUE);
  197.               FileFlush(HstHandle);
  198.              
  199.                 if(PrevTime < TimeCurrent()) PrevTime = TimeCurrent();
  200.                 else PrevTime++;
  201.                            
  202.                   CurVolume = 0;
  203.                 CurHigh = PrevHigh;
  204.                 CurLow = PrevHigh;  
  205.                
  206.                 UpdateChartWindow();                                                           
  207.           }
  208.         else if(Bid <= PrevLow-BoxPoints) {
  209.                        
  210.                 CurVolume++;                       
  211.                 FileSeek(HstHandle, LastFPos, SEEK_SET);
  212.                 FileWriteDouble(HstHandle, CurVolume, DOUBLE_VALUE);                       
  213.                
  214.                   PrevHigh = PrevHigh - BoxPoints;
  215.                   PrevLow = PrevLow - BoxPoints;
  216.                   PrevOpen = PrevHigh;
  217.                   PrevClose = PrevLow;
  218.                                                            
  219.                 FileWriteInteger(HstHandle, PrevTime, LONG_VALUE);
  220.                 FileWriteDouble(HstHandle, PrevOpen, DOUBLE_VALUE);
  221.                 FileWriteDouble(HstHandle, PrevLow, DOUBLE_VALUE);
  222.                 FileWriteDouble(HstHandle, PrevHigh, DOUBLE_VALUE);
  223.                 FileWriteDouble(HstHandle, PrevClose, DOUBLE_VALUE);
  224.                     LastFPos = FileTell(HstHandle);   // Remeber Last pos in file                                                                                         
  225.                 FileWriteDouble(HstHandle, 1, DOUBLE_VALUE);
  226.               FileFlush(HstHandle);
  227.              
  228.                 if(PrevTime < TimeCurrent()) PrevTime = TimeCurrent();
  229.                 else PrevTime++;             
  230.                            
  231.                   CurVolume = 0;
  232.                 CurHigh = PrevLow;
  233.                 CurLow = PrevLow;  
  234.                
  235.                 UpdateChartWindow();                                               
  236.              }
  237.         else {
  238.                                
  239.                 CurVolume++;
  240.                 FileSeek(HstHandle, LastFPos, SEEK_SET);
  241.                 FileWriteDouble(HstHandle, CurVolume, DOUBLE_VALUE);
  242.                
  243.                 if(CurHigh < Bid) CurHigh = Bid;
  244.                 if(CurLow > Bid) CurLow = Bid;
  245.                
  246.                 double CurOpen;               
  247.                 if(PrevHigh <= Bid) CurOpen = PrevHigh;
  248.                 else if(PrevLow >= Bid) CurOpen = PrevLow;
  249.                 else CurOpen = Bid;
  250.                
  251.                 double CurClose = Bid;
  252.                
  253.                 FileWriteInteger(HstHandle, PrevTime, LONG_VALUE);                // Time
  254.                 FileWriteDouble(HstHandle, CurOpen, DOUBLE_VALUE);                 // Open
  255.                 FileWriteDouble(HstHandle, CurLow, DOUBLE_VALUE);                // Low
  256.                 FileWriteDouble(HstHandle, CurHigh, DOUBLE_VALUE);                // High
  257.                 FileWriteDouble(HstHandle, CurClose, DOUBLE_VALUE);                // Close
  258.                 FileWriteDouble(HstHandle, 1, DOUBLE_VALUE);                        // Volume                               
  259.             FileFlush(HstHandle);
  260.             
  261.                 UpdateChartWindow();            
  262.              }
  263.              return(0);
  264. }
  265. //+------------------------------------------------------------------+
  266. int deinit() {
  267.         if(HstHandle >= 0) {
  268.                 FileClose(HstHandle);
  269.                 HstHandle = -1;
  270.         }
  271.            Comment("");
  272.         return(0);
  273. }
  274. //+------------------------------------------------------------------+
  275.    
复制代码

  TRO_Tunnel_dragon  代码:

  1. //+------------------------------------------------------------------+
  2. //|           TRO_Tunnel_dragon                                      |
  3. //|                                                                  |
  4. //|   Copyright ?2008, Avery T. Horton, Jr. aka TheRumpledOne       |
  5. //|                                                                  |
  6. //|   PO BOX 43575, TUCSON, AZ 85733                                 |
  7. //|                                                                  |
  8. //|   GIFTS AND DONATIONS ACCEPTED                                   |
  9. //|                                                                  |
  10. //+------------------------------------------------------------------+
  11. #property  copyright "Copyright ?2008, Avery T. Horton, Jr. aka TRO"
  12. #property indicator_chart_window
  13. #property indicator_buffers 8
  14. #property indicator_color1 DodgerBlue
  15. #property indicator_color2 Red
  16. #property indicator_color3 DodgerBlue
  17. /*
  18. #property indicator_color4 Purple
  19. #property indicator_color5 Teal
  20. #property indicator_color6 Orange
  21. #property indicator_color7 Red
  22. #property indicator_color8 Magenta
  23. */
  24. // indicators parameters
  25. extern bool   Show.PriceBox  = true ;
  26. extern int    myThickness    = 1 ;
  27. extern int    myStyle        = 0 ;
  28. extern int   myPeriod        = 0 ;
  29. extern int   myShift         = 0 ;
  30. extern string    notetype         = "0=SMA,1=EMA,2=SMMA,3=LWMA" ;
  31. extern string    noteprice        = "0=CLOSE,1=OPEN,2=HIGH,3=LOW,4=MEDIAN,5=PP,6=WEIGHT" ;
  32. extern int   myMA_Period1  = 50 ;
  33. extern int       MAType1   = 1;
  34. extern int       MAPrice1  = PRICE_HIGH ;
  35. extern int   myMA_Period2  = 50 ;
  36. extern int       MAType2   = 1;
  37. extern int       MAPrice2  = PRICE_CLOSE ;
  38. extern int   myMA_Period3  = 50 ;
  39. extern int       MAType3   = 1;
  40. extern int       MAPrice3  = PRICE_LOW ;
  41. //extern int   myWingDing  = 119 ;
  42. //---- buffers
  43. double P0Buffer[];
  44. double P1Buffer[];
  45. double P2Buffer[];
  46. double P3Buffer[];
  47. double P4Buffer[];
  48. double P5Buffer[];
  49. double P6Buffer[];
  50. double P7Buffer[];
  51. string tP0Buf = "drma_01" ;
  52. string tP1Buf = "drma_02" ;
  53. string tP2Buf = "drma_03" ;
  54. //+------------------------------------------------------------------+
  55. //| Custom indicator initialization function                         |
  56. //+------------------------------------------------------------------+
  57. int init()
  58.   {
  59. //---- name for indicator window
  60.    string short_name=" ";
  61.    IndicatorShortName(short_name);
  62.    SetIndexBuffer(0, P0Buffer);
  63.    SetIndexBuffer(1, P1Buffer);
  64.    SetIndexBuffer(2, P2Buffer);
  65.    SetIndexBuffer(3, P3Buffer);
  66.    SetIndexBuffer(4, P4Buffer);
  67.    SetIndexBuffer(5, P5Buffer);
  68.    SetIndexBuffer(6, P6Buffer);
  69.    SetIndexBuffer(7, P7Buffer);  
  70. //----
  71. SetIndexArrow(0, 119);
  72. SetIndexArrow(1, 119);
  73. SetIndexArrow(2, 119);
  74. SetIndexArrow(3, 119);
  75. SetIndexArrow(4, 119);
  76. SetIndexArrow(5, 119);
  77. SetIndexArrow(6, 119);
  78. SetIndexArrow(7, 119);
  79.    SetIndexStyle(0, DRAW_LINE, myStyle, myThickness, indicator_color1 );
  80.    SetIndexStyle(1, DRAW_LINE, myStyle, myThickness, indicator_color2 );   
  81.    SetIndexStyle(2, DRAW_LINE, myStyle, myThickness, indicator_color3 );
  82. /*   
  83.    SetIndexStyle(3, DRAW_ARROW, myStyle, myThickness, indicator_color4 );   
  84.    SetIndexStyle(4, DRAW_ARROW, myStyle, myThickness, indicator_color5 );
  85.    SetIndexStyle(5, DRAW_ARROW, myStyle, myThickness, indicator_color6 );   
  86.    SetIndexStyle(6, DRAW_ARROW, myStyle, myThickness, indicator_color7 );
  87.    SetIndexStyle(7, DRAW_ARROW, myStyle, myThickness, indicator_color8 );   
  88. */  
  89.    // setting the indicator values, which will be invisible on the chart
  90.    SetIndexEmptyValue(0,0);
  91.    SetIndexEmptyValue(1,0);
  92.    SetIndexEmptyValue(2,0);
  93.    SetIndexEmptyValue(3,0);
  94.    SetIndexEmptyValue(4,0);
  95.    SetIndexEmptyValue(5,0);
  96.    SetIndexEmptyValue(6,0);
  97.    SetIndexEmptyValue(7,0);
  98.    
  99.    return(0);
  100.   }
  101. //+------------------------------------------------------------------+
  102. //| Custom indicator deinitialization function                       |
  103. //+------------------------------------------------------------------+
  104. int deinit()
  105.   {
  106.    
  107.    ObjectDelete(tP0Buf);
  108.    ObjectDelete(tP1Buf);
  109.    ObjectDelete(tP2Buf);
  110.          
  111.    return(0);
  112.   }
  113. //+------------------------------------------------------------------+
  114. //| Custom indicator iteration function                              |
  115. //+------------------------------------------------------------------+
  116. int start()
  117.   {
  118.    datetime TimeArray[];
  119.    int i, dayi, counted_bars = IndicatorCounted();
  120. //---- check for possible errors
  121.    if(counted_bars < 0)
  122.        return(-1);
  123. //---- last counted bar will be recounted
  124.    if(counted_bars > 0)
  125.        counted_bars--;  
  126.    int limit = Bars - counted_bars;
  127. //----   
  128.    for(i = limit - 1; i >= 0; i--)
  129.      {
  130.         //---- Tricolor indicator code
  131. int BarShift = iBarShift(NULL,myPeriod,Time[i+myShift],true);

  132.         
  133. P0Buffer[i] = iMA(NULL,myPeriod,myMA_Period1,0,MAType1,MAPrice1,BarShift);      
  134. P1Buffer[i] = iMA(NULL,myPeriod,myMA_Period2,0,MAType2,MAPrice2,BarShift);
  135. P2Buffer[i] = iMA(NULL,myPeriod,myMA_Period3,0,MAType3,MAPrice3,BarShift);      

  136. }         
  137. if(Show.PriceBox)
  138. {
  139.   if (ObjectFind(tP0Buf) != 0)
  140.       {
  141.       
  142. //          ObjectCreate(tP0Buf,OBJ_HLINE,0,Time[0],X01);         
  143.           ObjectCreate(tP0Buf,OBJ_ARROW,0,Time[0],P0Buffer[0]);
  144.           ObjectSet(tP0Buf,OBJPROP_ARROWCODE,SYMBOL_RIGHTPRICE);
  145.           ObjectSet(tP0Buf,OBJPROP_COLOR,indicator_color1);  
  146.       }
  147.       else
  148.       {
  149.          ObjectMove(tP0Buf,0,Time[0],P0Buffer[0]);
  150.       }

  151.    
  152.     if (ObjectFind(tP1Buf) != 0)
  153.       {
  154.           ObjectCreate(tP1Buf,OBJ_ARROW,0,Time[0],P1Buffer[0]);
  155.           ObjectSet(tP1Buf,OBJPROP_ARROWCODE,SYMBOL_RIGHTPRICE);
  156.           ObjectSet(tP1Buf,OBJPROP_COLOR,indicator_color2);  
  157.       }
  158.       else
  159.       {
  160.          ObjectMove(tP1Buf,0,Time[0],P1Buffer[0]);
  161.       }
  162.     if (ObjectFind(tP2Buf) != 0)
  163.       {
  164.           ObjectCreate(tP2Buf,OBJ_ARROW,0,Time[0],P2Buffer[0]);
  165.           ObjectSet(tP2Buf,OBJPROP_ARROWCODE,SYMBOL_RIGHTPRICE);
  166.           ObjectSet(tP2Buf,OBJPROP_COLOR,indicator_color3);  
  167.       }
  168.       else
  169.       {
  170.          ObjectMove(tP2Buf,0,Time[0],P2Buffer[0]);
  171.       }
  172. }   
  173.        
  174.    return(0);
  175.   }
复制代码


Bmans Renko.jpg (69.8 KB, 下载次数: 27)

效果图

效果图

bmans_renko-system.rar

360.27 KB, 下载次数: 448, 下载积分: 金钱 -8

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏13 转播转播 分享分享 分享淘帖 支持支持 保留保留1

0

主题

210

积分

0

精华

见习操盘手

金钱
210 美元
权重
0
推荐
发表于 2016-12-6 14:06 | 只看该作者
谢谢分享!!下载了  不过不会用啊
回复 支持 1 反对 0

使用道具 举报

0

主题

28

积分

0

精华

外汇入门

金钱
28 美元
权重
0
板凳
发表于 2014-5-27 17:27 | 只看该作者
不错,可以参考下

0

主题

23

积分

0

精华

外汇入门

金钱
23 美元
权重
0
地板
发表于 2014-6-11 21:59 | 只看该作者

高端大气上档次,我等楷模

0

主题

20

积分

0

精华

外汇入门

金钱
20 美元
权重
0
5
发表于 2014-6-19 22:17 | 只看该作者
高端大气上档次,我等楷模

1

主题

237

积分

0

精华

见习操盘手

金钱
237 美元
权重
0
6
发表于 2014-10-4 09:01 | 只看该作者
谢谢楼主 分享。是什么好东东啊

0

主题

36

积分

0

精华

外汇入门

金钱
36 美元
权重
0
7
发表于 2014-10-13 00:18 | 只看该作者
谢谢分享,继续保持

0

主题

27

积分

0

精华

外汇入门

金钱
27 美元
权重
0
8
发表于 2014-11-27 20:19 | 只看该作者
不错,可以参考下

3

主题

3761

积分

0

精华

中级操盘手

金钱
3761 美元
权重
3
9
发表于 2014-12-3 11:19 | 只看该作者
谢谢分享
以交流促进步   视稳定为目标
回复

使用道具 举报

0

主题

100

积分

0

精华

见习操盘手

金钱
100 美元
权重
0
10
发表于 2015-1-16 11:34 | 只看该作者
值得参考!!谢谢楼主贡献

0

主题

112

积分

0

精华

见习操盘手

金钱
112 美元
权重
0
11
发表于 2015-2-27 20:49 | 只看该作者
谢谢分享  

1

主题

481

积分

0

精华

见习操盘手

金钱
481 美元
权重
0
12
发表于 2015-3-26 15:29 | 只看该作者
谢谢楼主贡献

2

主题

1万

积分

0

精华

操盘专家

金钱
16397 美元
权重
126
13
发表于 2015-5-13 16:54 | 只看该作者
看着很高端,也很明确,研究看看,多谢分享!

0

主题

42

积分

0

精华

外汇入门

金钱
42 美元
权重
0
14
发表于 2015-8-22 22:24 | 只看该作者
谢谢楼主分享!

0

主题

22

积分

0

精华

外汇入门

金钱
22 美元
权重
0
15
发表于 2016-11-29 23:04 | 只看该作者
这个指标好   感谢

0

主题

20

积分

0

精华

外汇入门

金钱
20 美元
权重
0
16
发表于 2016-12-2 12:21 | 只看该作者
准确率大概多少

0

主题

210

积分

0

精华

见习操盘手

金钱
210 美元
权重
0
17
发表于 2016-12-6 13:33 来自手机 | 只看该作者
看着有意思,下载试试

1

主题

32

积分

0

精华

外汇入门

金钱
32 美元
权重
0
18
发表于 2016-12-14 16:07 | 只看该作者
谢谢分享

4

主题

2438

积分

0

精华

中级操盘手

金钱
2438 美元
权重
0
19
发表于 2016-12-24 14:48 | 只看该作者
谢谢分享!!

1

主题

169

积分

0

精华

见习操盘手

金钱
169 美元
权重
0
20
发表于 2016-12-29 22:12 | 只看该作者
楼主辛苦了!楼主辛苦了!
您需要登录后才可以回帖 登录 | 快捷注册(禁q号)

本版积分规则

QQ|黄金吧|黄金论坛|手机版|指标下载|非农|目录|交易危机

版权所有: ©2014-2021 fx3q.com Powered by Discuz! X3
浙ICP备: ICP14039028

浙公网安备 33011802001420号

风险提示:杠杆风险高,交易要谨慎 声明:坛友发言和回复均为个人观点,不代表论坛立场。
若有侵权请联系fx3q@qq.com删除

快速回复 返回顶部 返回列表