Những series bài hay về phần mềm phân tích kỹ thuật AmiBroker
  • Thông báo


    + Trả lời Chủ đề
    Kết quả 1 đến 20 của 38

    Hybrid View

    1. #1
      Ngày tham gia
      Aug 2010
      Bài viết
      648
      Được cám ơn 325 lần trong 218 bài gởi

      Mặc định Những series bài hay về phần mềm phân tích kỹ thuật AmiBroker

      Đây là loạt bài Simple and Useful Codes về phần mềm phân tích kỹ thuật AmiBroker

      Zig-zag function of Metastock in AmiBroker


      //This is simply naming the code section
      _SECTION_BEGIN("Show Values at H&L");
      //asking user to input the maximum no. of bars n on which the values will be plotted
      n=Param("Values back",20,1,200,1);
      /*Zig is a common function which calculates the hi/lo based on minimum % movement (p)*/
      p=Param("zig %",5,1,100,1);
      //dist is used for proper plotting of hi/lo values
      dist = 0.8*ATR(15);
      //looping required in amibroker to plot on all bars which are drawn on chart
      for( i = 1; i < n; i++ )
      **
      /*for plottext function refer here: http://www.tradinganalysis.co.in/Ami.../plottext.html */
      PlotText(""+LastValue(Peak(H,p,i),True),BarCount-3-LastValue(PeakBars(H,p,i)),LastValue(dist,True)+La stValue(Peak(H,p,i),False),colorblue,ColorRGB(225, 225,225));
      PlotText(""+LastValue(Trough(L,p,i),True),BarCount-3-LastValue(TroughBars(L,p,i)),LastValue(Trough(L,p, i),False)-LastValue(dist,True),colorblue,ColorRGB(225,225,22 5));
      }

      _SECTION_END();

      An excel report of the High Low

      1. Go to ->automatic and pick afl containing the following code:

      Code:
      Change= 5;
      Filter= C;
      AddColumn(Trough(L,Change,1), "Low");
      AddColumn(Peak(H,Change,1), "Hi");

      Please note 'change' is the minimum % change which the zig function uses to calculate hi/lo
      2. Select 'current symbol' and hit 'explore' button. It gives you a table for a particular date and the most recent hi/lo corresponding to that date.

      3. To copy result to XL, select all->copy and then paste into a xl sheet
      Last edited by tradingpro8x; 12-09-2012 at 02:07 PM.

    2. #2
      Ngày tham gia
      Oct 2009
      Bài viết
      1,925
      Được cám ơn 617 lần trong 428 bài gởi

      Mặc định Kinh nghiệm phân tích kỹ thuật PTKT chứng khoán bằng MetaStock & AmiBroker

      Đây là loạt bài AmiBroker AFL Library về phần mềm phân tích kỹ thuật PTKT AmiBroker

      Details:

      Formula name: Adaptive Centre of Gravity

      Author/Uploader: Robert Dunbar - (email hidden)
      Date/Time added: 2012-07-16 08:45:48
      Origin: London
      Keywords: Adaptive Centre of Gravity, John Ehler
      Level: medium
      Flags: indicator
      DISCLAIMER: Most formulas present in AFL on-line library are submitted by the users and are provided here on an "as is" and "as available" basis. AmiBroker.com makes no representations or warranties of any kind to the contents or the operation of material presented here. We do not maintain nor provide technical support for 3rd party formulas.
      Description:

      You can contact me at "info at coding4ab dot com"

      Formula:

      //==================================
      //==================================
      // From John Ehler's book ===
      // Rocket Science for Traders ===
      // ===
      // AFL By Robert Dunbar ===
      //==================================
      //==================================

      Arrows = ParamToggle( "Buy/Sell Arrows", "No|Yes", 1 );
      PriceIn = ( ( H + L ) / 2 );
      Alpha = Param( "Alpha", 0.07, 0.01, 0.4, 0.01, 0.01 );
      CG = BullSig = BearSig = Trigger = Cycle = InstPeriod = Period = DeltaPhase =
      0;

      SmoothX = ( PriceIn + 2 * Ref( PriceIn, -1 ) + 2 * Ref( PriceIn, -2 ) + Ref(
      PriceIn, -3 ) ) / 6;

      for ( i = 10; i < BarCount; i++ )

      Cycle[i] = ( ( 1 - 0.5 * alpha ) ^ 2 ) * ( SmoothX[ i ] - 2 * SmoothX[ i -
      1 ] + SmoothX[ i - 2] ) + 2 * ( 1 - alpha ) * Cycle[ i - 1 ] - ( ( 1 - alpha ) ^
      2 ) * Cycle[ i - 2 ];
      Q1[i] = ( .0962 * cycle[i] + .5769 * cycle[i-2] - .5769 * cycle[i-4] -
      .0962 * cycle[i-6] ) * ( .5 + .08 * InstPeriod[i-1] );
      I1[i] = cycle[i-3];

      if ( Q1[i] != 0 AND Q1[i-1] != 0 )
      DeltaPhase[i] = ( I1[i] / Q1[i] - I1[i-1] / Q1[i-1] ) / ( 1 + I1[i] *
      I1[i-1] / ( Q1[i] * Q1[i-1] ) );

      if ( DeltaPhase[i] < 0.1 )
      DeltaPhase[i] = 0.1;

      if ( DeltaPhase[i] > 1.1 )
      DeltaPhase[i] = 1.1;

      mlen = 5;

      for ( k = mlen - 1; k >= 0; k-- )

      temparray[k] = DeltaPhase[i + k - ( mlen - 1 )];
      }

      temp = 0;

      for ( k = mlen - 1; k > 0; k-- )

      for ( j = mlen - 1; j > 0; j-- )

      if ( temparray[j-1] > temparray[j] )

      temp = temparray[j-1];
      temparray[j-1] = temparray[j];
      temparray[j] = temp;
      }
      }
      }

      MedianDelta[i] = temparray[mlen - 1 - ( mlen / 2 )];

      if ( MedianDelta[i] == 0 )
      DC[i] = 15;
      else
      DC[i] = 6.28318 / MedianDelta[i] + .5;

      InstPeriod[i] = .33 * DC[i] + .67 * InstPeriod[i-1];

      Period[i] = .15 * InstPeriod[i] + .85 * Period[i-1];

      IntPeriod[i] = int( Period[i] / 2 );

      num = 0;

      denom = 0;

      for ( j = 0; j < intPeriod[i]; j++ )

      num = num + ( 1 + j ) * PriceIn[i - j];
      denom = denom + PriceIn[i - j];
      }

      if ( denom != 0 )
      CG[i] = -num / denom + ( IntPeriod[i] + 1 ) / 2;
      }

      Trigger = Ref( CG, -1 );

      BullSig = IIf( Cross( CG, Trigger ), True, False );
      BearSig = IIf( Cross( Trigger, CG ), True, False );


      Plot( CG, "Adaptive_CG", colorLightBlue, styleLine );
      Plot( Trigger, "Trigger", colorRed, styleLine );
      Plot( 0 , "", colorWhite, styleDashed );

      if ( Arrows )

      PlotShapes( shapeUpArrow*BullSig, colorBrightGreen );
      PlotShapes( shapeDownArrow*BearSig, colorRed );
      }

    Thông tin của chủ đề

    Users Browsing this Thread

    Có 2 thành viên đang xem chủ đề này. (0 thành viên và 2 khách vãng lai)

       

    Similar Threads

    1. Một bài phân tích hay, có lý và khách quan
      By Brainstorm in forum Thảo luận Tình hình
      Trả lời: 0
      Bài viết cuối: 17-06-2012, 11:41 PM
    2. Phần mềm phân tích kỹ thuật
      By waterloo1815 in forum CLB Chứng khoán
      Trả lời: 2
      Bài viết cuối: 28-10-2009, 11:32 PM

    Bookmarks

    Quyền viết bài

    • Bạn Không thể gửi Chủ đề mới
    • Bạn Không thể Gửi trả lời
    • Bạn Không thể Gửi file đính kèm
    • Bạn Không thể Sửa bài viết của mình