Download BbSq (bbsqueeze) – OsMA MT4 Indicator

Bbsq-OsMA combines bbsqueeze and OsMA indicators. OsMA oscillates around the zero level and determines the trend while Bbsq indicator detects consolidations, tight range price bounces. This indicator helps forex traders to catch the big movements when a breakout happens after a consolidation period.

How to Trade With BbSq – OsMA:

Buy Signal: Wait for BbSq – OsMA indicator to cross above the zero level. In order to get more accurate signals and jump in the big waves, you can wait for green dots to appear first.

Sell Signal: Wait for BbSq – OsMA indicator to cross below the zero level. In order to get more accurate signals and jump in the big waves, you can wait for green dots to appear first.

 

[php]

//+——————————————————————+
//| BbSq-OsMA.mq4 |
//| Copyright © 2011, Remyn. |
//| |
//+——————————————————————+
#property copyright “Copyright © 2011, Remyn.”
#property link “http://codebase.mql4.com/”
//—- indicator settings
#property indicator_separate_window
#property indicator_buffers 4
#property indicator_color1 SteelBlue
#property indicator_color2 MediumBlue
//#property indicator_color3 Blue
#property indicator_color4 Lime
//—- indicator parameters
extern int bolPrd=20;
extern double bolDev=2.0;
extern int keltPrd=10;
extern double keltFactor=1.2;

extern int FastEMA=12;
extern int SlowEMA=26;
extern int SignalSMA=9;
extern int Histo=2;

//—- indicator buffers
double upOsMA[];
double downOsMA[];
double OsmaBuffer[];
double upK[];
//+——————————————————————+
//| Custom indicator initialization function |
//+——————————————————————+
int init()
{
//—- 2 additional buffers are used for counting.
IndicatorBuffers(4);
//—- drawing settings
SetIndexStyle(0, DRAW_HISTOGRAM, STYLE_SOLID, Histo);
SetIndexStyle(1, DRAW_HISTOGRAM, STYLE_SOLID, Histo);
SetIndexDrawBegin(0,SignalSMA);
IndicatorDigits(Digits+2);
//—- 3 indicator buffers mapping
SetIndexBuffer(0,upOsMA);
SetIndexBuffer(1,downOsMA);
SetIndexBuffer(2,OsmaBuffer);
SetIndexStyle(3,DRAW_ARROW,EMPTY);
SetIndexBuffer(3,upK);
SetIndexEmptyValue(3,EMPTY_VALUE);
SetIndexArrow(3,159);
//—- name for DataWindow and indicator subwindow label
IndicatorShortName(“OsMA(“+FastEMA+”,”+SlowEMA+”,”+SignalSMA+”)”);
//—- initialization done
return(0);
}
//+——————————————————————+
//| Moving Average of Oscillator |
//+——————————————————————+
int start()
{
int limit;
int counted_bars=IndicatorCounted();
double diff,d, std,bbs;
//—- 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++)
OsmaBuffer[i] = iOsMA(NULL, 0, FastEMA, SlowEMA, SignalSMA, PRICE_CLOSE, i);
//+——————————————————————+
for(i=0; i<limit; i++)
{
if (OsmaBuffer[i] > OsmaBuffer[i+1])
{
upOsMA[i] = OsmaBuffer[i];
downOsMA[i] = 0;
}
else
if(OsmaBuffer[i] < OsmaBuffer[i+1])
{
downOsMA[i] = OsmaBuffer[i];
upOsMA[i] = 0;
}
else
{
upOsMA[i] = 0;
downOsMA[i] = 0;
}
diff = iATR(NULL,0,keltPrd,i)*keltFactor;
std = iStdDev(NULL,0,bolPrd,MODE_SMA,0,PRICE_CLOSE,i);
bbs = bolDev * std / diff;
if(bbs<1) {
upK[i]=0;
} else {
upK[i]=EMPTY_VALUE;
}
}
//—- done
return(0);
}
//+——————————————————————+

&nbsp;

[/php]

Click Here to Download

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *