Deprecated: Assigning the return value of new by reference is deprecated in /home/forex/public_html/wp-settings.php on line 520

Deprecated: Assigning the return value of new by reference is deprecated in /home/forex/public_html/wp-settings.php on line 535

Deprecated: Assigning the return value of new by reference is deprecated in /home/forex/public_html/wp-settings.php on line 542

Deprecated: Assigning the return value of new by reference is deprecated in /home/forex/public_html/wp-settings.php on line 578

Deprecated: Function set_magic_quotes_runtime() is deprecated in /home/forex/public_html/wp-settings.php on line 18
T :forex decode

T Archives

two lines.mq4

//+------------------------------------------------------------------+
//|                                                    two lines.mq4 |
//|                       Copyright ?2004, MetaQuotes Software Corp. |
//|                                         http://www.metaquotes.net |
//|                                Made/Modified by Alejandro Galindo |
//|                                                                   |
//|                                                                   |
//|                       if this work/modification is helpful to you |
//|                      send me a PayPal donation to ag@elcactus.com |
//|                                         any help is apreciated :) |
//|                                                           Thanks. |
//+-------------------------------------------------------------------+
#property copyright "Copyright ?2005. Alejandro Galindo"
#property link      "http://tradingstuff.pisem.net"

#property indicator_chart_window

extern int OpenTimeHr=9;
extern int OpenTimeMin=30;
extern int CloseTimeHr=14;
extern int CloseTimeMin=30;
extern int CountBars=500;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
   int shift, NumBars=500;
   double CloseTime,OpenTime;

   if (Bars<CountBars)  { NumBars=Bars-1; } else { NumBars=CountBars; }

   for  (shift=Bars-1;shift>=0;shift--) {

      OpenTime=StrToTime(TimeDay(Time[shift])+" "+OpenTimeHr+":"+OpenTimeMin);
      CloseTime=StrToTime(TimeDay(Time[shift])+" "+CloseTimeHr+":"+CloseTimeMin);

	  if (TimeHour(Time[shift])== OpenTimeHr && TimeMinute(Time[shift])==OpenTimeMin) {
	     if(ObjectFind("OpenTime"+shift) != 0)
         {
            ObjectCreate("OpenTime"+shift, OBJ_VLINE, 0, Time[shift], 0);
            ObjectSet("OpenTime"+shift, OBJPROP_STYLE, STYLE_SOLID);
            ObjectSet("OpenTime"+shift, OBJPROP_COLOR, Blue);
         }
      }

     	  if (TimeHour(Time[shift])== CloseTimeHr && TimeMinute(Time[shift])==CloseTimeMin) {
	     if(ObjectFind("CloseTime"+shift) != 0)
         {
            ObjectCreate("CloseTime"+shift, OBJ_VLINE, 0, Time[shift], 0);
            ObjectSet("CloseTime"+shift, OBJPROP_STYLE, STYLE_SOLID);
            ObjectSet("CloseTime"+shift, OBJPROP_COLOR, Red);
         }
      }

   }

   return(0);
  }
//+------------------------------------------------------------------+

[Post to Twitter] Tweet This Post  [Post to Delicious] Delicious This Post  [Post to Ping.fm] Ping This Post  [Post to StumbleUpon] Stumble This Post 

tunnel.mq4

//+------------------------------------------------------------------+
//|                                                        Vegas.mq4 |
//|                                                           Mr.Bah |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Mr.Bah"
#property link      ""

#property indicator_chart_window
#property indicator_buffers 8
#property indicator_color1 Green
#property indicator_color2 Blue
#property indicator_color3 Red
#property indicator_color4 Red
#property indicator_color5 Red
#property indicator_color6 Red
#property indicator_color7 Red
#property indicator_color8 Red
//---- input parameters
extern bool      Alerts=true;
extern int       RiskModel=1;
extern int       MA1=144;
extern int       MA2=169;
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
double ExtMapBuffer5[];
double ExtMapBuffer6[];
double ExtMapBuffer7[];
double ExtMapBuffer8[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,ExtMapBuffer2);
   SetIndexStyle(2,DRAW_LINE);
   SetIndexBuffer(2,ExtMapBuffer3);
   SetIndexStyle(3,DRAW_LINE);
   SetIndexBuffer(3,ExtMapBuffer4);
   SetIndexStyle(4,DRAW_LINE);
   SetIndexBuffer(4,ExtMapBuffer5);
   SetIndexStyle(5,DRAW_LINE);
   SetIndexBuffer(5,ExtMapBuffer6);
   SetIndexStyle(6,DRAW_LINE);
   SetIndexBuffer(6,ExtMapBuffer7);
   SetIndexStyle(7,DRAW_LINE);
   SetIndexBuffer(7,ExtMapBuffer8);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int limit;
   int    counted_bars=IndicatorCounted();
  //---- check for possible errors
   if(counted_bars<0) return(-1);
  //---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
  //---- main loop
     for(int i=0; i<limit; i++)
       {
        //---- ma_shift set to 0 because SetIndexShift called abowe
         ExtMapBuffer1[i]=iMA(NULL,0,144,0,MODE_EMA,PRICE_CLOSE,i);
         ExtMapBuffer2[i]=iMA(NULL,0,169,0,MODE_EMA,PRICE_CLOSE,i);

         //Model #1 34,55,89
         if(RiskModel==1)
         {
            ExtMapBuffer3[i]=ExtMapBuffer2[i]+34*Point;
            ExtMapBuffer4[i]=ExtMapBuffer2[i]+55*Point;
            ExtMapBuffer5[i]=ExtMapBuffer2[i]+89*Point;

            ExtMapBuffer6[i]=ExtMapBuffer2[i]-34*Point;
            ExtMapBuffer7[i]=ExtMapBuffer2[i]-55*Point;
            ExtMapBuffer8[i]=ExtMapBuffer2[i]-89*Point;
         }

         //Model #2 55,89,144
         if(RiskModel==2)
         {
            ExtMapBuffer3[i]=ExtMapBuffer2[i]+55*Point;
            ExtMapBuffer4[i]=ExtMapBuffer2[i]+89*Point;
            ExtMapBuffer5[i]=ExtMapBuffer2[i]+144*Point;

            ExtMapBuffer6[i]=ExtMapBuffer2[i]-55*Point;
            ExtMapBuffer7[i]=ExtMapBuffer2[i]-88*Point;
            ExtMapBuffer8[i]=ExtMapBuffer2[i]-144*Point;
         }

          //Model #3 89,144,233
         if(RiskModel==3)
         {
            ExtMapBuffer3[i]=ExtMapBuffer2[i]+89*Point;
            ExtMapBuffer4[i]=ExtMapBuffer2[i]+144*Point;
            ExtMapBuffer5[i]=ExtMapBuffer2[i]+233*Point;

            ExtMapBuffer6[i]=ExtMapBuffer2[i]-89*Point;
            ExtMapBuffer7[i]=ExtMapBuffer2[i]-144*Point;
            ExtMapBuffer8[i]=ExtMapBuffer2[i]-233*Point;
         }

          //Model #4 144,233,377
         if(RiskModel==4)
         {
            ExtMapBuffer3[i]=ExtMapBuffer2[i]+144*Point;
            ExtMapBuffer4[i]=ExtMapBuffer2[i]+233*Point;
            ExtMapBuffer5[i]=ExtMapBuffer2[i]+377*Point;

            ExtMapBuffer6[i]=ExtMapBuffer2[i]-144*Point;
            ExtMapBuffer7[i]=ExtMapBuffer2[i]-233*Point;
            ExtMapBuffer8[i]=ExtMapBuffer2[i]-377*Point;
         }

         Comment("\nRISK MODEL #",RiskModel," (1-4)\n\nEMA144 - ",ExtMapBuffer1[limit],"\nEMA169 - ",ExtMapBuffer2[limit],
         "\n\nF+1 - ",ExtMapBuffer3[limit],"\nF+2 - ",ExtMapBuffer4[limit],
         "\nF+3 - ",ExtMapBuffer5[limit],"\n\nF-1 - ",ExtMapBuffer6[limit],
         "\nF-2 - ",ExtMapBuffer7[limit],"\nF-3 - ",ExtMapBuffer8[limit]);
       }

       //+--------------------------------------------------------------------------+
       //-                          ALERTS    PlaySound("alert.wav");               -
       //+--------------------------------------------------------------------------+
      if(Alerts)
      {
         if(Close[i]==ExtMapBuffer1[i] || Close[i]==ExtMapBuffer2[i])
         {
            PlaySound("alert.wav");
         }
         if(Close[i]==ExtMapBuffer3[i] || Close[i]==ExtMapBuffer4[i] || Close[i]==ExtMapBuffer5[i])
         {
            PlaySound("alert.wav");
         }
         if(Close[i]==ExtMapBuffer6[i] || Close[i]==ExtMapBuffer7[i] || Close[i]==ExtMapBuffer8[i])
         {
            PlaySound("alert.wav");
         }
      }

  //---- done

//----

//----
   return(0);
  }
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+

[Post to Twitter] Tweet This Post  [Post to Delicious] Delicious This Post  [Post to Ping.fm] Ping This Post  [Post to StumbleUpon] Stumble This Post 

TTM.mq4

//+------------------------------------------------------------------+
//|                                                          TTM.mq4 |
//|                             Copyright ?2005, adoleh2000 and dwt5|
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
//| Based on code offered at MT Yahoo group                          |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2005, adoleh2000"
#property link      "adoleh2000@yahoo.com"
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Blue
#property indicator_color2 Red
#property indicator_color3 EMPTY
#property indicator_color4 EMPTY

//---- input parameters
extern int TTMperiod=6;
//---- buffers
double HighBuffer[];
double LowBuffer[];
double  Low_ma,
	     High_ma,
	     Low_third[],
	     High_third[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   string short_name;
//---- indicator line
   SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,2);
   SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,2);
   SetIndexStyle(2,DRAW_LINE,STYLE_SOLID,2);
   SetIndexStyle(3,DRAW_LINE,STYLE_SOLID,2);

   SetIndexBuffer(0,HighBuffer);
   SetIndexBuffer(1,LowBuffer);
   SetIndexBuffer(2,High_third);
   SetIndexBuffer(3,Low_third);

//---- name for DataWindow and indicator subwindow label
   short_name="TTM";
   IndicatorShortName(short_name);
   SetIndexLabel(0,short_name);

//----
   SetIndexDrawBegin(0,10);
   SetIndexDrawBegin(1,10);
   SetIndexDrawBegin(2,10);
   SetIndexDrawBegin(3,10);

//----

   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- TODO: add your code here

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted(),i,shift;

//---- TODO: add your code here
if (counted_bars==0) counted_bars=TTMperiod+1;
i=(Bars-counted_bars);

for (shift=i; shift>=0;shift--)
{

Low_ma= iMA(NULL,0,TTMperiod,0,MODE_EMA,PRICE_LOW,shift);
High_ma = iMA(NULL,0,TTMperiod,0,MODE_EMA,PRICE_HIGH,shift);
Low_third[shift] = (High_ma- Low_ma) / 3 + Low_ma;
High_third[shift] = 2 * (High_ma- Low_ma) / 3 + Low_ma;

//Comment ("Low_third=",Low_third[shift],"; ","High_third=",High_third[shift]);

if (Close[shift] > High_third[shift])
   {
      HighBuffer[shift]=High[shift];
      LowBuffer[shift]=Low[shift];
   }

   else

if (Close[shift] < Low_third[shift])
   {
      LowBuffer[shift]=High[shift];
      HighBuffer[shift]=Low[shift];
    }

 //----
}
   return(0);
  }
//+------------------------------------------------------------------+

[Post to Twitter] Tweet This Post  [Post to Delicious] Delicious This Post  [Post to Ping.fm] Ping This Post  [Post to StumbleUpon] Stumble This Post 

ttm-trend.mq4

//+------------------------------------------------------------------+
//|                                                    ttm-trend.mq4 |
//|                Copyright ?2005, Nick Bilak, beluck[AT]gmail.com |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2005, Nick Bilak"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color2 Red
#property indicator_color1 Blue
//---- input parameters
extern int       CompBars=6;
//---- buffers
double buf1[];
double buf2[];
double haOpen[];
double haClose[];
double icolor[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
	IndicatorBuffers(5);
   SetIndexStyle(0,DRAW_HISTOGRAM);
   SetIndexBuffer(0,buf1);
   SetIndexStyle(1,DRAW_HISTOGRAM);
   SetIndexBuffer(1,buf2);
   SetIndexBuffer(2,haOpen);
   SetIndexBuffer(3,haClose);
   SetIndexBuffer(4,icolor);

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {

   int shift,limit,i;
   int counted_bars=IndicatorCounted();
   if (counted_bars<0) return(-1);
   if (counted_bars>0) counted_bars--;
   limit=Bars-4;
   if(counted_bars>=1) limit=Bars-counted_bars-4;

 	double dip,dim,stm,sts,macdm,macds;

	if (haOpen[limit+3]==0.0) haOpen[limit+3]=Open[limit+3];
	haClose[limit+3] = (Open[limit+3]+High[limit+3]+Low[limit+3]+Close[limit+3])/4.0;

   for(shift = limit+2; shift >= 0; shift--) {
		haOpen[shift] = (haOpen[shift+1]+haClose[shift+1])/2.0;
	   haClose[shift] = (Open[shift]+High[shift]+Low[shift]+Close[shift])/4.0;

		if (haClose[shift] > haOpen[shift]) icolor[shift] = 1;
		else icolor[shift] = -1;

		for (i=1; i<=CompBars; i++) {
			if ( haOpen[shift] <= MathMax(haOpen[shift+i],haClose[shift+i]) &&
	 			  haOpen[shift] >= MathMin(haOpen[shift+i],haClose[shift+i]) &&
				  haClose[shift] <= MathMax(haOpen[shift+i],haClose[shift+i]) &&
				  haClose[shift] >= MathMin(haOpen[shift+i],haClose[shift+i]) )
						icolor[shift] = icolor[shift+i];
		}
		if (icolor[shift]>0) {
			buf1[shift]=High[shift];
			buf2[shift]=Low[shift];
		} else {
			buf2[shift]=High[shift];
			buf1[shift]=Low[shift];
		}
	}
  }
//+------------------------------------------------------------------+

[Post to Twitter] Tweet This Post  [Post to Delicious] Delicious This Post  [Post to Ping.fm] Ping This Post  [Post to StumbleUpon] Stumble This Post 

TTF_TR.mq4

//+------------------------------------------------------------------+
//|                                       Trendscalpindic.mq4        |
//|                        Based on Nick Beluk's TTF implementation  |
//|                        No redrawing, no lookahead, nosmoothing   |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2005, Nick Bilak"
#property link      "beluck[at]gmail.com"

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 LightSeaGreen
#property indicator_color2 Red
//---- input parameters
extern int TTFbars=15;
//15=default number of bars for computation
//---- buffers
double MainBuffer[];
double SignalBuffer[];
//----
int TopLine=100;
int BottomLine=-100;
int draw_begin1=0;
int draw_begin2=0;
double  HighestHighRecent=0;
double  HighestHighOlder =0;
double  LowestLowRecent =0;
double  LowestLowOlder =0;
double  BuyPower =0;
double  SellPower=0;
double  TTF=0;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   string short_name;
//---- 2 additional buffers are used for counting.
   IndicatorBuffers(2);
//---- indicator lines
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0, MainBuffer);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1, SignalBuffer);
//---- name for DataWindow and indicator subwindow label
   short_name="TTF_TR("+TTFbars+")";
   IndicatorShortName(short_name);
   SetIndexLabel(0,short_name);
   SetIndexLabel(1,"Signal");
//----
   draw_begin1=TTFbars*2+1;
   draw_begin2=draw_begin1;
   SetIndexDrawBegin(0,draw_begin1);
   SetIndexDrawBegin(1,draw_begin2);

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| ttf                                            |
//+------------------------------------------------------------------+
int start()
  {
   int    i,k;
   int    counted_bars=IndicatorCounted();
   double price;
//----
   if(Bars<=draw_begin2) return(0);
//---- initial zero
   if(counted_bars<1)
     {
      for(i=1;i<=draw_begin1;i++) MainBuffer[Bars-i]=0;
      for(i=1;i<=draw_begin2;i++) SignalBuffer[Bars-i]=0;
     }
//---- %K line
   i=Bars-draw_begin1;
   if(counted_bars>draw_begin1) i=Bars-counted_bars-1;
   while(i>=0)
     {
   HighestHighRecent=High[Highest(Symbol(), 0, MODE_HIGH,1,i)];
   HighestHighOlder=High[Highest(Symbol(), 0, MODE_HIGH,TTFbars,i+1)];
   LowestLowRecent=Low [Lowest (Symbol(), 0, MODE_LOW,1,i)];
   LowestLowOlder=Low [Lowest (Symbol(), 0, MODE_LOW,TTFbars,i+1)];
   BuyPower=HighestHighRecent-LowestLowOlder;
   SellPower=HighestHighOlder-LowestLowRecent;
   TTF=(BuyPower-SellPower)/(0.5*(BuyPower+SellPower))*100;
     //Print (Time[i], "   ", HighestHighRecent, ",  ",HighestHighOlder, ",  ", LowestLowRecent, ",  ",LowestLowOlder    );

  MainBuffer[i]=TTF;
  i--;
 }
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   int limit=Bars-counted_bars;
//---- signal line is simple movimg average
   for(i=0; i<limit; i++) {
      if (MainBuffer[i]>=0)
         SignalBuffer[i]=TopLine;
      else
         SignalBuffer[i]=BottomLine;
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+

[Post to Twitter] Tweet This Post  [Post to Delicious] Delicious This Post  [Post to Ping.fm] Ping This Post  [Post to StumbleUpon] Stumble This Post 

TTF_look-ahead.mq4

//+------------------------------------------------------------------+
//|                                                   ttf.mq4        |
//|                      Copyright ?2005, Nick Bilak                |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2005, Nick Bilak"
#property link      "beluck[at]gmail.com"

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 LightSeaGreen
#property indicator_color2 Red
//---- input parameters
extern int TTFbars=7;
//15=default number of bars for computation
extern int TopLine=100;
extern int BottomLine=-100;
extern int t3_period=6;
extern double b=1.618;
//---- buffers
double MainBuffer[];
double SignalBuffer[];
//----
int draw_begin1=0;
int draw_begin2=0;
double b2=0;
double b3=0;
double c1=0;
double c2=0;
double c3=0;
double c4=0;
double r=0;
double w1=0;
double w2=0;
double e1 = 0;
double e2 = 0;
double e3 = 0;
double e4 = 0;
double e5 = 0;
double e6 = 0;
double  HighestHighRecent=0;
double  HighestHighOlder =0;
double  LowestLowRecent =0;
double  LowestLowOlder =0;
double  BuyPower =0;
double  SellPower=0;
double  TTF=0;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   string short_name;
//---- 2 additional buffers are used for counting.
   IndicatorBuffers(2);
//---- indicator lines
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0, MainBuffer);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1, SignalBuffer);
//---- name for DataWindow and indicator subwindow label
   short_name="TTF_look-ahead ("+TTFbars+") ";
   IndicatorShortName(short_name);
   SetIndexLabel(0,short_name);
   SetIndexLabel(1,"Signal");
//----
   draw_begin1=TTFbars*2+1+TTFbars*3;
   draw_begin2=draw_begin1;
   SetIndexDrawBegin(0,draw_begin1);
   SetIndexDrawBegin(1,draw_begin2);

   b2=b*b;
   b3=b2*b;
   c1=-b3;
   c2=(3*(b2+b3));
   c3=-3*(2*b2+b+b3);
   c4=(1+3*b+b3+3*b2);

   r=t3_period;

   if (r<1) r=1;
   r = 1 + 0.5*(r-1);
   w1 = 2 / (r + 1);
   w2 = 1 - w1;

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| ttf                                            |
//+------------------------------------------------------------------+
int start()
  {
   int    i,k;
   int    counted_bars=IndicatorCounted();
   double price;
//----
   if(Bars<=draw_begin2) return(0);
//---- initial zero
   if(counted_bars<1)
     {
      for(i=1;i<=draw_begin1;i++) MainBuffer[Bars-i]=0;
      for(i=1;i<=draw_begin2;i++) SignalBuffer[Bars-i]=0;
     }
//---- %K line
   i=Bars-draw_begin1;
   if(counted_bars>draw_begin1) i=Bars-counted_bars-1;
   while(i>=0)
     {

  HighestHighRecent=High[Highest(NULL,0,MODE_HIGH,TTFbars,i-TTFbars+1)];//High[Highest(MODE_HIGH,shift+TTFbars-1,TTFbars)];
  HighestHighOlder =High[Highest(NULL,0,MODE_HIGH,TTFbars,i+1)];//High[Highest(MODE_HIGH,shift+TTFbars*2-1,TTFbars)];
  LowestLowRecent =Low[Lowest(NULL,0,MODE_LOW,TTFbars,i-TTFbars+1)];//Low [Lowest (MODE_LOW ,shift+TTFbars-1,TTFbars)];
  LowestLowOlder =Low[Lowest(NULL,0,MODE_LOW,TTFbars,i+1)];//Low [Lowest (MODE_LOW ,shift+TTFbars*2-1,TTFbars)];
  BuyPower =HighestHighRecent-LowestLowOlder;
  SellPower=HighestHighOlder -LowestLowRecent;
  TTF=(BuyPower-SellPower)/(0.5*(BuyPower+SellPower))*100;

  e1 = w1*TTF + w2*e1;
  e2 = w1*e1 + w2*e2;
  e3 = w1*e2 + w2*e3;
  e4 = w1*e3 + w2*e4;
  e5 = w1*e4 + w2*e5;
  e6 = w1*e5 + w2*e6;

  TTF = c1*e6 + c2*e5 + c3*e4 + c4*e3;

  MainBuffer[i]=TTF;
  i--;
 }
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   int limit=Bars-counted_bars;
//---- signal line is simple movimg average
   for(i=0; i<limit; i++) {
      if (MainBuffer[i]>=0)
         SignalBuffer[i]=TopLine;
      else
         SignalBuffer[i]=BottomLine;
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+

[Post to Twitter] Tweet This Post  [Post to Delicious] Delicious This Post  [Post to Ping.fm] Ping This Post  [Post to StumbleUpon] Stumble This Post 

TTF_hist.mq4

//+------------------------------------------------------------------+
//|                                                          TTF.mq4 |
//|                                   Copyright ?2005, Nick Bilak   |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2005, Nick Bilak"
#property link      "beluck[at]gmail.com"

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 LightSeaGreen
#property indicator_color2 Red
//---- input parameters
extern int TTFbars=8;
//15=default number of bars for computation
extern int TopLine=75;
extern int BottomLine=-75;
extern int t3_period=3;
extern double b=0.7;
//---- buffers
double MainBuffer[];
double SignalBuffer[];
//----
int draw_begin1=0;
int draw_begin2=0;
double b2=0;
double b3=0;
double c1=0;
double c2=0;
double c3=0;
double c4=0;
double r=0;
double w1=0;
double w2=0;
double e1 = 0;
double e2 = 0;
double e3 = 0;
double e4 = 0;
double e5 = 0;
double e6 = 0;
double  HighestHighRecent=0;
double  HighestHighOlder =0;
double  LowestLowRecent =0;
double  LowestLowOlder =0;
double  BuyPower =0;
double  SellPower=0;
double  TTF=0;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   string short_name;
//---- 2 additional buffers are used for counting.
   IndicatorBuffers(2);
//---- indicator lines
   SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,2);
   SetIndexBuffer(0, MainBuffer);
   SetIndexStyle(1,DRAW_LINE,2);
   SetIndexBuffer(1, SignalBuffer);
//---- name for DataWindow and indicator subwindow label
  short_name="TTF("+TTFbars+")";
  IndicatorShortName(short_name);
  SetIndexLabel(0,short_name);
  SetIndexLabel(1,"Signal");

//----
   draw_begin1=TTFbars*2+1;
   draw_begin2=draw_begin1;
   SetIndexDrawBegin(0,draw_begin1);
   SetIndexDrawBegin(1,draw_begin2);

   b2=b*b;
   b3=b2*b;
   c1=-b3;
   c2=(3*(b2+b3));
   c3=-3*(2*b2+b+b3);
   c4=(1+3*b+b3+3*b2);

   r=t3_period;

   if (r<1) r=1;
   r = 1 + 0.5*(r-1);
   w1 = 2 / (r + 1);
   w2 = 1 - w1;

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| ttf                                            |
//+------------------------------------------------------------------+
int start()
  {
   int    i,k;
   int    counted_bars=IndicatorCounted();
   double price;
//----
   if(Bars<=draw_begin2) return(0);
//---- initial zero
   if(counted_bars<1)
     {
      for(i=1;i<=draw_begin1;i++) MainBuffer[Bars-i]=0;
      for(i=1;i<=draw_begin2;i++) SignalBuffer[Bars-i]=0;
     }
//---- %K line
   i=Bars-draw_begin1;
   if(counted_bars>draw_begin1) i=Bars-counted_bars-1;
   while(i>=0)
     {
  HighestHighRecent=High[Highest(NULL,0,MODE_HIGH,TTFbars,i)];//High[Highest(MODE_HIGH,shift+TTFbars-1,TTFbars)];
  HighestHighOlder =High[Highest(NULL,0,MODE_HIGH,TTFbars,i+TTFbars)];//High[Highest(MODE_HIGH,shift+TTFbars*2-1,TTFbars)];
  LowestLowRecent =Low[Lowest(NULL,0,MODE_LOW,TTFbars,i)];//Low [Lowest (MODE_LOW ,shift+TTFbars-1,TTFbars)];
  LowestLowOlder =Low[Lowest(NULL,0,MODE_LOW,TTFbars,i+TTFbars)];//Low [Lowest (MODE_LOW ,shift+TTFbars*2-1,TTFbars)];
  BuyPower =HighestHighRecent-LowestLowOlder;
  SellPower=HighestHighOlder -LowestLowRecent;
  TTF=(BuyPower-SellPower)/(0.5*(BuyPower+SellPower))*100;

  e1 = w1*TTF + w2*e1;
  e2 = w1*e1 + w2*e2;
  e3 = w1*e2 + w2*e3;
  e4 = w1*e3 + w2*e4;
  e5 = w1*e4 + w2*e5;
  e6 = w1*e5 + w2*e6;

  TTF = c1*e6 + c2*e5 + c3*e4 + c4*e3;

  MainBuffer[i]=TTF;
  i--;
 }
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   int limit=Bars-counted_bars;
//---- signal line is simple movimg average
   for(i=0; i<limit; i++) {
      if (MainBuffer[i]>=0)
         SignalBuffer[i]=TopLine;
      else
         SignalBuffer[i]=BottomLine;
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+

[Post to Twitter] Tweet This Post  [Post to Delicious] Delicious This Post  [Post to Ping.fm] Ping This Post  [Post to StumbleUpon] Stumble This Post 

TTF.mq4

//+------------------------------------------------------------------+
//|                                                   ttf.mq4        |
//|                      Copyright ?2005, Nick Bilak                |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2005, Nick Bilak"
#property link      "beluck[at]gmail.com"

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 LightSeaGreen
#property indicator_color2 Red
//---- input parameters
extern int TTFbars=8;
//15=default number of bars for computation
extern int TopLine=75;
extern int BottomLine=-75;
extern int t3_period=3;
extern double b=0.7;
//---- buffers
double MainBuffer[];
double SignalBuffer[];
//----
int draw_begin1=0;
int draw_begin2=0;
double b2=0;
double b3=0;
double c1=0;
double c2=0;
double c3=0;
double c4=0;
double r=0;
double w1=0;
double w2=0;
double e1 = 0;
double e2 = 0;
double e3 = 0;
double e4 = 0;
double e5 = 0;
double e6 = 0;
double  HighestHighRecent=0;
double  HighestHighOlder =0;
double  LowestLowRecent =0;
double  LowestLowOlder =0;
double  BuyPower =0;
double  SellPower=0;
double  TTF=0;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   string short_name;
//---- 2 additional buffers are used for counting.
   IndicatorBuffers(2);
//---- indicator lines
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0, MainBuffer);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1, SignalBuffer);
//---- name for DataWindow and indicator subwindow label
   short_name="TTF("+TTFbars;
   IndicatorShortName(short_name);
   SetIndexLabel(0,short_name);
   SetIndexLabel(1,"Signal");
//----
   draw_begin1=TTFbars*2+1;
   draw_begin2=draw_begin1;
   SetIndexDrawBegin(0,draw_begin1);
   SetIndexDrawBegin(1,draw_begin2);

   b2=b*b;
   b3=b2*b;
   c1=-b3;
   c2=(3*(b2+b3));
   c3=-3*(2*b2+b+b3);
   c4=(1+3*b+b3+3*b2);

   r=t3_period;

   if (r<1) r=1;
   r = 1 + 0.5*(r-1);
   w1 = 2 / (r + 1);
   w2 = 1 - w1;

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| ttf                                            |
//+------------------------------------------------------------------+
int start()
  {
   int    i,k;
   int    counted_bars=IndicatorCounted();
   double price;
//----
   if(Bars<=draw_begin2) return(0);
//---- initial zero
   if(counted_bars<1)
     {
      for(i=1;i<=draw_begin1;i++) MainBuffer[Bars-i]=0;
      for(i=1;i<=draw_begin2;i++) SignalBuffer[Bars-i]=0;
     }
//---- %K line
   i=Bars-draw_begin1;
   if(counted_bars>draw_begin1) i=Bars-counted_bars-1;
   while(i>=0)
     {
  HighestHighRecent=High[Highest(NULL,0,MODE_HIGH,TTFbars,i)];//High[Highest(MODE_HIGH,shift+TTFbars-1,TTFbars)];
  HighestHighOlder =High[Highest(NULL,0,MODE_HIGH,TTFbars,i+TTFbars)];//High[Highest(MODE_HIGH,shift+TTFbars*2-1,TTFbars)];
  LowestLowRecent =Low[Lowest(NULL,0,MODE_LOW,TTFbars,i)];//Low [Lowest (MODE_LOW ,shift+TTFbars-1,TTFbars)];
  LowestLowOlder =Low[Lowest(NULL,0,MODE_LOW,TTFbars,i+TTFbars)];//Low [Lowest (MODE_LOW ,shift+TTFbars*2-1,TTFbars)];
  BuyPower =HighestHighRecent-LowestLowOlder;
  SellPower=HighestHighOlder -LowestLowRecent;
  TTF=(BuyPower-SellPower)/(0.5*(BuyPower+SellPower))*100;

  e1 = w1*TTF + w2*e1;
  e2 = w1*e1 + w2*e2;
  e3 = w1*e2 + w2*e3;
  e4 = w1*e3 + w2*e4;
  e5 = w1*e4 + w2*e5;
  e6 = w1*e5 + w2*e6;

  TTF = c1*e6 + c2*e5 + c3*e4 + c4*e3;

  MainBuffer[i]=TTF;
  i--;
 }
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   int limit=Bars-counted_bars;
//---- signal line is simple movimg average
   for(i=0; i<limit; i++) {
      if (MainBuffer[i]>=0)
         SignalBuffer[i]=TopLine;
      else
         SignalBuffer[i]=BottomLine;
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+

[Post to Twitter] Tweet This Post  [Post to Delicious] Delicious This Post  [Post to Ping.fm] Ping This Post  [Post to StumbleUpon] Stumble This Post 

TTF+-+MW.mq4

//+------------------------------------------------------------------+
//|                                                          TTF.mq4 |
//|                                                           MojoFX |
//|                                         http://fx.studiomojo.com |
//+------------------------------------------------------------------+
#property copyright "MojoFX"
#property link      "http://fx.studiomojo.com"
//---- indicators setting
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 GreenYellow
//---- input parameters
extern int       TTFbars=12;
extern int       t3_period=6;
extern double    b=1.618;
//---- buffers
double ExtMapBuffer1[],ExtMapBuffer2[];
double b2,b3,c1,c2,c3,c4,e1,e2,e3,e4,e5,e6,w1,w2,TTF,r;
double HighestHighRecent,HighestHighOlder,LowestLowRecent,LowestLowOlder;
double BuyPower,SellPower;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {

//---- indicators
   SetIndexStyle(0,DRAW_ARROW);
   SetIndexArrow(0,159);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexEmptyValue(0,0.0);
   SetIndexStyle(1,DRAW_ARROW);
   SetIndexArrow(1,159);
   SetIndexBuffer(1,ExtMapBuffer2);
   SetIndexEmptyValue(1,0.0);

//----
    b2=b*b;
    b3=b2*b;
    c1=-b3;
    c2=(3*(b2+b3));
    c3=-3*(2*b2+b+b3);
    c4=(1+3*b+b3+3*b2);

    r=t3_period;

    if (r<1) r=1;
    r = 1 + 0.5*(r-1);
    w1 = 2 / (r + 1);
    w2 = 1 - w1;

    e1=0;
	e2=0;
	e3=0;
	e4=0;
	e5=0;
	e6=0;
//----
    return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- TODO: add your code here

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
    int counted_bars=IndicatorCounted();
    if (counted_bars<0) return(-1);
    if (counted_bars>0) counted_bars--;
    int limit=Bars-counted_bars;

//----
   for(int i=limit; i>=0; i--)
      {
      HighestHighRecent=High[Highest(NULL,0,2,TTFbars,i-TTFbars+1)];
      HighestHighOlder =High[Highest(NULL,0,2,TTFbars,i+1)];
      LowestLowRecent =Low[Lowest(NULL,0,1,TTFbars,i-TTFbars+1)];
      LowestLowOlder =Low[Lowest(NULL,0,1,TTFbars,i+1)];
      BuyPower =HighestHighRecent-LowestLowOlder;
      SellPower=HighestHighOlder -LowestLowRecent;
      TTF=(BuyPower-SellPower)/(0.5*(BuyPower+SellPower))*100;

      e1 = w1*TTF + w2*e1;
      e2 = w1*e1 + w2*e2;
      e3 = w1*e2 + w2*e3;
      e4 = w1*e3 + w2*e4;
      e5 = w1*e4 + w2*e5;
      e6 = w1*e5 + w2*e6;

      TTF = c1*e6 + c2*e5 + c3*e4 + c4*e3;

      if (TTF <= (-100))
         {
         ExtMapBuffer1[i] = High[i]+4*Point;
         ExtMapBuffer2[i] = 0;
         }

      if (TTF >= 100)
         {
         ExtMapBuffer1[i] = 0;
         ExtMapBuffer2[i] = Low[i]-4*Point;
         }

      if (TTF>(-100) && TTF<100){
         ExtMapBuffer1[i]=0;
         ExtMapBuffer2[i]=0;
         }

      }

//----
   return(0);
  }
//+------------------------------------------------------------------+

[Post to Twitter] Tweet This Post  [Post to Delicious] Delicious This Post  [Post to Ping.fm] Ping This Post  [Post to StumbleUpon] Stumble This Post 

TTF - trigger factor.mq4

//+------------------------------------------------------------------+
//|                                                   ttf.mq4        |
//|                      Copyright ?2005, Nick Bilak                |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2005, Nick Bilak"
#property link      "beluck[at]gmail.com"

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 LightSeaGreen
#property indicator_color2 Red
//---- input parameters
extern int TTFbars=8;
//15=default number of bars for computation
extern int TopLine=75;
extern int BottomLine=-75;
extern int t3_period=3;
extern double b=0.7;
//---- buffers
double MainBuffer[];
double SignalBuffer[];
//----
int draw_begin1=0;
int draw_begin2=0;
double b2=0;
double b3=0;
double c1=0;
double c2=0;
double c3=0;
double c4=0;
double r=0;
double w1=0;
double w2=0;
double e1 = 0;
double e2 = 0;
double e3 = 0;
double e4 = 0;
double e5 = 0;
double e6 = 0;
double  HighestHighRecent=0;
double  HighestHighOlder =0;
double  LowestLowRecent =0;
double  LowestLowOlder =0;
double  BuyPower =0;
double  SellPower=0;
double  TTF=0;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   string short_name;
//---- 2 additional buffers are used for counting.
   IndicatorBuffers(2);
//---- indicator lines
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0, MainBuffer);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1, SignalBuffer);
//---- name for DataWindow and indicator subwindow label
   short_name="TTF("+TTFbars;
   IndicatorShortName(short_name);
   SetIndexLabel(0,short_name);
   SetIndexLabel(1,"Signal");
//----
   draw_begin1=TTFbars*2+1;
   draw_begin2=draw_begin1;
   SetIndexDrawBegin(0,draw_begin1);
   SetIndexDrawBegin(1,draw_begin2);

   b2=b*b;
   b3=b2*b;
   c1=-b3;
   c2=(3*(b2+b3));
   c3=-3*(2*b2+b+b3);
   c4=(1+3*b+b3+3*b2);

   r=t3_period;

   if (r<1) r=1;
   r = 1 + 0.5*(r-1);
   w1 = 2 / (r + 1);
   w2 = 1 - w1;

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| ttf                                            |
//+------------------------------------------------------------------+
int start()
  {
   int    i,k;
   int    counted_bars=IndicatorCounted();
   double price;
//----
   if(Bars<=draw_begin2) return(0);
//---- initial zero
   if(counted_bars<1)
     {
      for(i=1;i<=draw_begin1;i++) MainBuffer[Bars-i]=0;
      for(i=1;i<=draw_begin2;i++) SignalBuffer[Bars-i]=0;
     }
//---- %K line
   i=Bars-draw_begin1;
   if(counted_bars>draw_begin1) i=Bars-counted_bars-1;
   while(i>=0)
     {
  HighestHighRecent=High[Highest(NULL,0,MODE_HIGH,TTFbars,i)];//High[Highest(MODE_HIGH,shift+TTFbars-1,TTFbars)];
  HighestHighOlder =High[Highest(NULL,0,MODE_HIGH,TTFbars,i+TTFbars)];//High[Highest(MODE_HIGH,shift+TTFbars*2-1,TTFbars)];
  LowestLowRecent =Low[Lowest(NULL,0,MODE_LOW,TTFbars,i)];//Low [Lowest (MODE_LOW ,shift+TTFbars-1,TTFbars)];
  LowestLowOlder =Low[Lowest(NULL,0,MODE_LOW,TTFbars,i+TTFbars)];//Low [Lowest (MODE_LOW ,shift+TTFbars*2-1,TTFbars)];
  BuyPower =HighestHighRecent-LowestLowOlder;
  SellPower=HighestHighOlder -LowestLowRecent;
  TTF=(BuyPower-SellPower)/(0.5*(BuyPower+SellPower))*100;

  e1 = w1*TTF + w2*e1;
  e2 = w1*e1 + w2*e2;
  e3 = w1*e2 + w2*e3;
  e4 = w1*e3 + w2*e4;
  e5 = w1*e4 + w2*e5;
  e6 = w1*e5 + w2*e6;

  TTF = c1*e6 + c2*e5 + c3*e4 + c4*e3;

  MainBuffer[i]=TTF;
  i--;
 }
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   int limit=Bars-counted_bars;
//---- signal line is simple movimg average
   for(i=0; i<limit; i++) {
      if (MainBuffer[i]>=0)
         SignalBuffer[i]=TopLine;
      else
         SignalBuffer[i]=BottomLine;
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+

[Post to Twitter] Tweet This Post  [Post to Delicious] Delicious This Post  [Post to Ping.fm] Ping This Post  [Post to StumbleUpon] Stumble This Post 

 Page 1 of 11  1  2  3  4  5 » ...  Last » 

Tweet This Post links powered by Tweet This v1.3.9, a WordPress plugin for Twitter.