Sunday, January 12, 2014

ACCELERATOR


//+------------------------------------------------------------------+
//|                                                  Accelerator.mq4 |
//|                      Copyright © 2005, MetaQuotes Software Corp. |
//|                                       http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property  copyright "Copyright © 2005, MetaQuotes Software Corp."
#property  link      "http://www.metaquotes.net/"
//---- indicator settings
#property  indicator_separate_window
#property  indicator_buffers 3
#property  indicator_color1  Black
#property  indicator_color2  Green
#property  indicator_color3  Red
//---- indicator buffers
double     ExtBuffer0[];
double     ExtBuffer1[];
double     ExtBuffer2[];
double     ExtBuffer3[];
double     ExtBuffer4[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- 2 additional buffers are used for counting.
   IndicatorBuffers(5);
//---- drawing settings
   SetIndexStyle(0,DRAW_NONE);
   SetIndexStyle(1,DRAW_HISTOGRAM);
   SetIndexStyle(2,DRAW_HISTOGRAM);
   IndicatorDigits(Digits+2);
   SetIndexDrawBegin(0,38);
   SetIndexDrawBegin(1,38);
   SetIndexDrawBegin(2,38);
//---- 4 indicator buffers mapping
   SetIndexBuffer(0,ExtBuffer0);
   SetIndexBuffer(1,ExtBuffer1);
   SetIndexBuffer(2,ExtBuffer2);
   SetIndexBuffer(3,ExtBuffer3);
   SetIndexBuffer(4,ExtBuffer4);
//---- name for DataWindow and indicator subwindow label
   IndicatorShortName("AC");
   SetIndexLabel(1,NULL);
   SetIndexLabel(2,NULL);
//---- initialization done
   return(0);
  }
//+------------------------------------------------------------------+
//| Accelerator/Decelerator Oscillator                               |
//+------------------------------------------------------------------+
int start()
  {
   int    limit;
   int    counted_bars=IndicatorCounted();
   double prev,current;
   //---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
   //---- macd counted in the 1-st additional buffer
   for(int i=0; i<limit; i++)
      ExtBuffer3[i]=iMA(NULL,0,5,0,MODE_SMA,PRICE_MEDIAN,i)-iMA(NULL,0,34,0,MODE_SMA,PRICE_MEDIAN,i);
   //---- signal line counted in the 2-nd additional buffer
   for(i=0; i<limit; i++)
      ExtBuffer4[i]=iMAOnArray(ExtBuffer3,Bars,5,0,MODE_SMA,i);
   //---- dispatch values between 2 buffers
   bool up=true;
   for(i=limit-1; i>=0; i--)
     {
      current=ExtBuffer3[i]-ExtBuffer4[i];
      prev=ExtBuffer3[i+1]-ExtBuffer4[i+1];
      if(current>prev) up=true;
      if(current<prev) up=false;
      if(!up)
        {
         ExtBuffer2[i]=current;
         ExtBuffer1[i]=0.0;
        }
      else
        {
         ExtBuffer1[i]=current;
         ExtBuffer2[i]=0.0;
        }
       ExtBuffer0[i]=current;
     }
   //---- done
   return(0);
  }
//+------------------------------------------------------------------+

Saturday, January 11, 2014

ENGULFING




BULLISH ENGULFING: a large up body engulfing a preceding smaller down body, happening during a downtrend. The up body does not necessarily engulf the shadows of the down body but totally engulfs the body itself, the length of the first down candlestick in Bullish Engulfing is not important, it can even be a Doji, the second one is a normal or long up candlestick, the up body is longer than the previous down body. The buying pressure overcomes selling and finally the market closes above the open of the previous day, the downtrend is damaged, prices must cross above the last close for confirmation. 


BEARISH ENGULFING: A large down body engulfing a preceding smaller up body, happening during an uptrend. The down body does not necessarily engulf the shadows of the up body but totally engulfs the body itself, the length of the first up candlestick in Bearish Engulfing is not important, it can even be a Doji, the second one is a normal or long down candlestick, the down body is longer than the previous up body. The selling pressure overcomes buying and finally the market closes below the open of the previous one, the uptrend is damaged, prices must cross below the last close for confirmation.

Friday, January 10, 2014

BELT HOLD




BULLISH BELT HOLD: an Up Opening Marubozu or an up Marubozu (opens lower than the two preceding down candlesticks) occurs in a downtrend, opening on the low, a rally begins during the time against the overall trend of the market, stopping with a close near the high, leaving a small shadow on top of the candle, a significant gap in the direction of the prevailing downtrend, after the market opening then moving in the opposite direction, prices must cross above the last close for confirmation.
BEARISH BELT HOLD: a down Opening Marubozu or a down Marubozu (open higher than the two preceding up candlesticks) occurs in an uptrend, opening on the high, prices fall against the overall trend of the market, stopping with a close near the low, leaving a small shadow at the bottom of the candle, the resistance against the trend will be stronger. The market gaps up and opens at its high, closes near to the low, a long down body without upper shadow. The market opens, things change rapidly, the market moves in the opposite direction. The confirmation level is defined as the last close. Prices must cross below the last close for confirmation. 

MOVING AVERAGE




MOVING AVERAGE: showing the price value over a specific period of time. Buy or sell signal occurs if there is a "crossover".  



//+------------------------------------------------------------------+ //| Custom Moving Average.mq4 | //| Copyright © 2004, MetaQuotes Software Corp. | //| http://www.metaquotes.net/ | //+------------------------------------------------------------------+ #property copyright "Copyright © 2004, MetaQuotes Software Corp." #property link "http://www.metaquotes.net/" #property indicator_chart_window #property indicator_buffers 1 #property indicator_color1 Red //---- indicator parameters extern int MA_Period=13; extern int MA_Shift=0; extern int MA_Method=0; //---- indicator buffers double ExtMapBuffer[]; //---- int ExtCountedBars=0; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { int draw_begin; string short_name; //---- drawing settings SetIndexStyle(0,DRAW_LINE); SetIndexShift(0,MA_Shift); IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)); if(MA_Period<2 data-blogger-escaped-1="" data-blogger-escaped-2="" data-blogger-escaped-3="" data-blogger-escaped-:="" data-blogger-escaped-ars="" data-blogger-escaped-bar="" data-blogger-escaped-be="" data-blogger-escaped-break="" data-blogger-escaped-buffers="" data-blogger-escaped-case="" data-blogger-escaped-check="" data-blogger-escaped-counted="" data-blogger-escaped-default="" data-blogger-escaped-done="" data-blogger-escaped-draw_begin="" data-blogger-escaped-eriod="" data-blogger-escaped-errors="" data-blogger-escaped-ethod="" data-blogger-escaped-extcountedbars="IndicatorCounted();" data-blogger-escaped-for="" data-blogger-escaped-if="" data-blogger-escaped-indicator="" data-blogger-escaped-indicatorshortname="" data-blogger-escaped-initialization="" data-blogger-escaped-int="" data-blogger-escaped-last="" data-blogger-escaped-ma_method="0;" data-blogger-escaped-ma_period="13;" data-blogger-escaped-mapping="" data-blogger-escaped-name="" data-blogger-escaped-possible="" data-blogger-escaped-recounted="" data-blogger-escaped-return="" data-blogger-escaped-setindexbuffer="" data-blogger-escaped-setindexdrawbegin="" data-blogger-escaped-short="" data-blogger-escaped-short_name="" data-blogger-escaped-start="" data-blogger-escaped-switch="" data-blogger-escaped-will="" data-blogger-escaped-xtcountedbars="" data-blogger-escaped-xtmapbuffer="">0) ExtCountedBars--; //---- switch(MA_Method) { case 0 : sma(); break; case 1 : ema(); break; case 2 : smma(); break; case 3 : lwma(); } //---- done return(0); } //+------------------------------------------------------------------+ //| Simple Moving Average | //+------------------------------------------------------------------+ void sma() { double sum=0; int i,pos=Bars-ExtCountedBars-1; //---- initial accumulation if(pos=0) { sum+=Close[pos]; ExtMapBuffer[pos]=sum/MA_Period; sum-=Close[pos+MA_Period-1]; pos--; } //---- zero initial bars if(ExtCountedBars<1 data-blogger-escaped-ars-i="" data-blogger-escaped-average="" data-blogger-escaped-double="" data-blogger-escaped-ema="" data-blogger-escaped-exponential="" data-blogger-escaped-extmapbuffer="" data-blogger-escaped-for="" data-blogger-escaped-i="1;i<MA_Period;i++)" data-blogger-escaped-if="" data-blogger-escaped-int="" data-blogger-escaped-moving="" data-blogger-escaped-pos="Bars-2;" data-blogger-escaped-pr="2.0/(MA_Period+1);" data-blogger-escaped-void="" data-blogger-escaped-xtcountedbars="">2) pos=Bars-ExtCountedBars-1; //---- main calculation loop while(pos>=0) { if(pos==Bars-2) ExtMapBuffer[pos+1]=Close[pos+1]; ExtMapBuffer[pos]=Close[pos]*pr+ExtMapBuffer[pos+1]*(1-pr); pos--; } } //+------------------------------------------------------------------+ //| Smoothed Moving Average | //+------------------------------------------------------------------+ void smma() { double sum=0; int i,k,pos=Bars-ExtCountedBars+1; //---- main calculation loop pos=Bars-MA_Period; if(pos>Bars-ExtCountedBars) pos=Bars-ExtCountedBars; while(pos>=0) { if(pos==Bars-MA_Period) { //---- initial accumulation for(i=0,k=pos;i=0) { ExtMapBuffer[pos]=sum/weight; if(pos==0) break; pos--; i--; price=Close[pos]; sum=sum-lsum+price*MA_Period; lsum-=Close[i]; lsum+=price; } //---- zero initial bars if(ExtCountedBars

Wednesday, January 8, 2014

HAMMER & HANGING MAN

BULLISH HAMMER: occur at the bottom of a trend or during a downtrend (it is hammering out of a bottom), the market prevails not shorter than an average candlestick, no or a very tiny upper downtrend, both up and down candlestick are acceptable, the lower shadow is at least twice as long as the body but not shorter than an average candlestick, no or a very tiny upper shadow, the Hammer’s body is lower than both of the two preceding down candlesticks. After decline ceased, the market returns to the high, the market fails to continue selling. If the body is up, it is better for the bulls, prices must cross above the top of the Hammer’s body level for confirmation.
BEARISH HANGING MAN: occur at the top of a trend or during an uptrend (looks like a hanging man), the, market prevails uptrend, both up and down candlestick are acceptable, the lower shadow of this candlestick is at least twice as long as the body but shadow, the top of the Hanging Man’s body is above both of the two preceding up candlesticks, selling pressure is starting to increase, the sellers pushed prices lower during the session. If the body is down, it is better for the bears.vel is defined as the midpoint of Hanging Man’s lower shadow. Prices must cross below the lower shadow for confirmation.

SPINNING TOP

UP SPINNING TOP: a candlestick has a tiny up body with upper and lower shadows that have a greater length than the body, it is considered as a type of Doji, and will act as a Doji. The market moves higher and then sharply lower, or vice versa, closing above the opening price creating a tiny white body, representing complete indecision between the bulls and the bears, the length of the shadows is not important. An Up Spinning Top occurs after a long rally or a long Up candlestick to imply weakness among the bulls and warning a potential change or an interruption in the trend; occurring after a long decline or a long down candlestick to imply weakness among the bears and warning a potential change or an interruption in the trend. Need more other candlesticks to confirm a trend. DOWN SPINNING TOP: a candlestick has a tiny down body with upper and lower shadows that have a greater length than the body, it is considered as a type of Doji, and will act as a Doji. The market moves higher and then sharply lower, or vice versa, closing below the opening price creating a tiny black body, representing complete indecision between the bulls and the bears, the actual length of the shadows is not important. A Down Spinning Top occurs after a long rally or long up candlestick, this imply weakness among the bulls and warning a potential change or an interruption in the trend; occurring after a long decline or a long down candlestick to imply weakness among the bears and warning a potential change or an interruption in the trend. Need more other candlesticks to confirm a trend.

UMBRELLA

UMBRELLA: is a type of Doji with no upper shadow but a long lower shadow (also called the DRAGONFLY DOJI), indicating that sellers mostly dominated trading during the time able to drive prices lower. However, buyers resurfaced at the end of the time and successfully pushed prices back to the opening level and to the time’s high, signaling a bullish reversal at the bottom if it appears after a long downtrend, long down candlestick or occurring at a value.
INVERTED UMBRELLA: is a type of Doji with no lower shadow but a long upper shadow (also called the GRAVESTONE DOJI), indicating that buyers dominated trading and able to drive prices higher during the time. However, sellers resurfaced by the end of the time and pushed prices back to the opening price level and to the time’s low, pointing out evidence for buying pressure and indicating a potential bullish reversal if it occurs after a long downtrend, long down candlestick or at a support level. Likewise it may signal a failed rallyand indicating a potential bearish reversal if occurring after a long uptrend, long up candlestick or at a resistance level. Bearish or bullish confirmation is required in both situations.