Dynamic Trend Indicator

If you need an Indicator or Signal developed or translated from other language, please post all Indicator development REQUESTS to this section here.

Moderator: admin

Dynamic Trend Indicator

Postby Hybrid » Fri Aug 06, 2010 10:02 pm

Hi, Fxcodebase Team,

I have found a link to Dynamic Trend Indicator, where they claim that it works well on all time frames (not only 1 Hour +). It looks good on the charts that are shown, catching tops and bottoms:

http://www.trade-profit.com/indicator/f ... icator.php

Could someone please develop this version of the indicator for Marketscope?

I have also found the following code (from a different source), not sure if it is the same version.


Code: Select all
// +------------------------------------------------------------------+
// | The percentage indicator basis on break                          |
// | of the dynamic price channel                                     |
// | BDPC_Percent.mq4                                                 |
// | Copyright © 2004, OfficeFX Group                                 |
// | http: // officefx.nm.ru                                          |
// +------------------------------------------------------------------+
#property copyright " Copyright © 2004, OfficeFX Group "
#property link " http:// officefx.nm.ru "

#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 MediumOrchid // BUY signal
#property indicator_color2 Blue // BUY signal
#property indicator_color3 Red // SELL signal
//----Indicator Buffers--------------------------------------------+
double DynamicLineTrend []; // Data buffer for dynamic line trend
double BUYSignals []; // Data buffer for BUY signals

double SELLSignals []; // Data buffer for SELL signals //----User defines-------------------------------------------------
extern int Percent=1; // Percent dynamic channel  15  Main Trend 10
extern int MaxPeriod=14; // 12 FOR H1 Maximal period for calculate trend 50 Main Trend 89
 //----Variables----------------------------------------------------+
 int Shift=0;  // Current bar for calculate trend //
//+------------------------------------------------------------------+
//| Custom indicator initialization function                        |
//+------------------------------------------------------------------+
 int init ()
 {
SetIndexStyle (0, DRAW_LINE);
SetIndexBuffer(0, DynamicLineTrend);

SetIndexStyle (1, DRAW_ARROW);
SetIndexArrow (1,233);
SetIndexBuffer(1, BUYSignals);
 
SetIndexStyle (2, DRAW_ARROW);
SetIndexArrow (2,234);
SetIndexBuffer(2, SELLSignals);
 return (0);
 }
//-------------------------------------------------------------------+

// +------------------------------------------------------------------+
// | Custom indicator iteration function                              |
// +------------------------------------------------------------------+
 int start ()
 { 
// Get digits of Symbol
 double point=MarketInfo (Symbol (), MODE_POINT);
// Set count bars for calculate trend
 int Counted_Bars=IndicatorCounted ()-MaxPeriod;
//----Calculation DynamicLineTrend---------------------------------+
   for ( Shift = Counted_Bars; Shift>=0; Shift--)
  {
// Calculate of maximal period
      if (Close [Shift] <DynamicLineTrend [Shift+1])
         {
            // Calculate Upper trend
            DynamicLineTrend [Shift] =Close [Highest (NULL, 0, MODE_CLOSE, MaxPeriod, Shift+1)]-Percent*point;
         }
   
      if (Close [Shift]>=DynamicLineTrend [Shift+1])
         {
            // Calculate Down trend
               DynamicLineTrend [Shift] =Close [Lowest (NULL, 0, MODE_CLOSE, MaxPeriod, Shift+1)] +Percent*point;
         }

// Checkcrosses DynamicLineTrend and Price
      if (Close [Shift+3]> DynamicLineTrend [Shift+2])             
      if (Close [Shift+2] <DynamicLineTrend [Shift+3])
             BUYSignals [Shift] =Low [Shift]-10*point;
         else
             BUYSignals [Shift] =0;
       
         else
             BUYSignals [Shift] =0;
             
      if (Close [Shift+2] <DynamicLineTrend [Shift+1])       
      if (Close [Shift+2]> DynamicLineTrend [Shift+3])
             SELLSignals [Shift] =High [Shift]-10*point;
         else
             SELLSignals [Shift] =0;
       
         else
             SELLSignals [Shift] =0;
   }
//-------------------------------------------------------------------+
return (0);
}
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


Thank you.
Hybrid
 
Posts: 42
Joined: Fri Apr 02, 2010 7:52 am

Re: Dynamic Trend Indicator

Postby Alexander.Gettinger » Tue Aug 17, 2010 2:52 am

You may find indicator here: viewtopic.php?f=17&t=1839
Alexander.Gettinger
FXCodeBase: Confirmed User
 
Posts: 3785
Joined: Wed Mar 31, 2010 9:40 pm
Location: Russia, Omsk


Return to Indicator and Signal Requests

Who is online

Users browsing this forum: No registered users and 20 guests