Multi Timeframe Indicators - page 900

 

Hi , Mr tools and mladen

could you please make this to MTF and alerts the zero crossing?

thank you

Files:
i-g-cci2.mq4  4 kb
 
Jozy:
Mr Mladen, or Mrtools, could we have some alerts on this indicator? On zero cross and colour change?

Thanks

Jozy

Hi Jozy, think you forgot to post the indicator.

 
mladen:
Isn't it already showing the newest threads (threads with newest posts) automatically when you get to TSD?

Sorry. I guess I did not express myself clearly. I don't go to page forex-tsd.com because I have saved some bookmarks of threads I'm interested in like this "multiple-timeframe-indicators" and I wanted to ask if someone knew how to adjust the URL of this bookmark so when I click it, it automatically opens the last page of this thread instead of the page at the time I saved the bookmark.

Rather by accident it worked one time like that, but then I got a new computer and now I can't remember. I was just thinking maybe somebody might know the solution. If not, no problem as I don't want to disturb this thread further. Just did not know where else to post my question.

 

Dear senior members

is it possible to have this bollinger bands indicator adjustable to 2 and 3 deviations? it is currently set at 1 deviation and i have tried to change the settings but it then stops showing any arrow alerts

Thank you

//+------------------------------------------------------------------+

//| Bands.mq4 |

//| |

//| |

//+------------------------------------------------------------------+

#property indicator_chart_window

#property indicator_buffers 5

#property indicator_color1 LightSeaGreen

#property indicator_color2 LightSeaGreen

#property indicator_color3 LightSeaGreen

#property indicator_color4 LimeGreen

#property indicator_color5 Orange

//

//

//

//

//

extern string TimeFrame = "current time frame";

extern int BandsLength = 4;

extern double BandsDeviation = 1.0;

extern int AppliedPrice = 0;

extern int BandsMaMode = 0;

extern string note = "turn on Alert = true; turn off = false";

extern bool alertsOn = true;

extern bool alertsOnCurrent = true;

extern bool alertsMessage = true;

extern bool alertsSound = true;

extern bool alertsNotify = false;

extern bool alertsEmail = false;

extern string soundFile = "alert2.wav";

extern int arrowthickness = 1;

//

//

//

//

//

double Ma[];

double UpMa[];

double DnMa[];

double CrossUp[];

double CrossDn[];

double trend[];

//

//

//

//

//

string indicatorFileName;

bool calculateValue;

bool returnBars;

int timeFrame;

//+------------------------------------------------------------------+

//| |

//+------------------------------------------------------------------+

//

//

//

//

//

int init()

{

IndicatorBuffers(6);

IndicatorDigits(Digits);

SetIndexBuffer(0,Ma);

SetIndexBuffer(1,UpMa);

SetIndexBuffer(2,DnMa);

SetIndexBuffer(3,CrossUp); SetIndexStyle(3,DRAW_ARROW,0,arrowthickness); SetIndexArrow(3,233);

SetIndexBuffer(4,CrossDn ); SetIndexStyle(4,DRAW_ARROW,0,arrowthickness); SetIndexArrow(4,234);

SetIndexBuffer(5,trend);

//

//

//

//

//

indicatorFileName = WindowExpertName();

returnBars = TimeFrame=="returnBars"; if (returnBars) return(0);

calculateValue = TimeFrame=="calculateValue"; if (calculateValue) return(0);

timeFrame = stringToTimeFrame(TimeFrame);

IndicatorShortName(timeFrameToString(timeFrame)+" Bollinger Bands Alerts Arrows");

return(0);

}

//

//

//

//

//

int deinit() { return(0); }

//+------------------------------------------------------------------+

//| |

//+------------------------------------------------------------------+

//

//

//

//

//

int start()

{

int counted_bars=IndicatorCounted();

int i,limit;

if(counted_bars<0) return(-1);

if(counted_bars>0) counted_bars--;

limit=MathMin(Bars-1,Bars-counted_bars-1);

if (returnBars) { Ma[0] = limit+1; return(0); }

//

//

//

//

//

if (calculateValue || timeFrame==Period())

{

for (i = limit; i >= 0; i--)

{

double StdDev = iStdDev(NULL,0,BandsLength,0,BandsMaMode,AppliedPrice,i);

Ma = iMA(NULL,0,BandsLength,0,BandsMaMode,AppliedPrice,i);

UpMa = Ma + (StdDev*BandsDeviation);

DnMa = Ma - (StdDev*BandsDeviation);

trend = 0;

if (Close>UpMa) trend = 1;

if (Close<DnMa) trend =-1;

//

//

//

//

//

CrossUp = EMPTY_VALUE;

CrossDn = EMPTY_VALUE;

if (trend!= trend)

if (trend == 1 && trend != 3) CrossDn = High + iATR(NULL,0,20,i)/2;

if (trend == -1 && trend !=-3) CrossUp = Low - iATR(NULL,0,20,i)/2;

}

manageAlerts();

return(0);

}

//

//

//

//

//

limit = MathMax(limit,MathMin(Bars-1,iCustom(NULL,timeFrame,indicatorFileName,"returnBars",0,0)*timeFrame/Period()));

for(i=limit; i>=0; i--)

{

int y = iBarShift(NULL,timeFrame,Time);

Ma = iCustom(NULL,timeFrame,indicatorFileName,"calculateValue",BandsLength,BandsDeviation,AppliedPrice,BandsMaMode,0,y);

UpMa = iCustom(NULL,timeFrame,indicatorFileName,"calculateValue",BandsLength,BandsDeviation,AppliedPrice,BandsMaMode,1,y);

DnMa = iCustom(NULL,timeFrame,indicatorFileName,"calculateValue",BandsLength,BandsDeviation,AppliedPrice,BandsMaMode,2,y);

trend = iCustom(NULL,timeFrame,indicatorFileName,"calculateValue",BandsLength,BandsDeviation,AppliedPrice,BandsMaMode,5,y);

CrossUp = EMPTY_VALUE;

CrossDn = EMPTY_VALUE;

if (trend!= trend)

if (trend == 1 && trend != 1) CrossDn = High + iATR(NULL,0,20,i)/2;

if (trend == -1 && trend !=-1) CrossUp = Low - iATR(NULL,0,20,i)/2;

}

manageAlerts();

return(0);

}

//

//

//

//

//

void manageAlerts()

{

if (!calculateValue && alertsOn)

{

if (alertsOnCurrent)

int whichBar = 0;

else whichBar = 1; whichBar = iBarShift(NULL,0,iTime(NULL,timeFrame,whichBar));

if (trend[whichBar] != trend[whichBar+1])

{

if (trend[whichBar+1] == 1 && trend[whichBar] != 1) doAlert(whichBar,"sell");

if (trend[whichBar+1] == -1 && trend[whichBar] !=-1) doAlert(whichBar,"buy");

}

}

}

//

//

//

//

//

void doAlert(int forBar, string doWhat)

{

static string previousAlert="nothing";

static datetime previousTime;

string message;

if (previousAlert != doWhat || previousTime != Time[forBar]) {

previousAlert = doWhat;

previousTime = Time[forBar];

//

//

//

//

//

message = StringConcatenate(Symbol()," at ",TimeToStr(TimeLocal(),TIME_SECONDS)," - ",timeFrameToString(Period())+" Bollinger Bands ",doWhat);

if (alertsMessage) Alert(message);

if (alertsNotify) SendNotification(message);

if (alertsEmail) SendMail(StringConcatenate(Symbol()," Bollinger Bands "),message);

if (alertsSound) PlaySound(soundFile);

}

}

//+-------------------------------------------------------------------

//|

//+-------------------------------------------------------------------

//

//

//

//

//

string sTfTable[] = {"M1","M5","M15","M30","H1","H4","D1","W1","MN"};

int iTfTable[] = {1,5,15,30,60,240,1440,10080,43200};

//

//

//

//

//

int stringToTimeFrame(string tfs)

{

tfs = StringUpperCase(tfs);

for (int i=ArraySize(iTfTable)-1; i>=0; i--)

if (tfs==sTfTable || tfs==""+iTfTable) return(MathMax(iTfTable,Period()));

return(Period());

}

//

//

//

//

//

string timeFrameToString(int tf)

{

for (int i=ArraySize(iTfTable)-1; i>=0; i--)

if (tf==iTfTable) return(sTfTable);

return("");

}

//

//

//

//

//

string StringUpperCase(string str)

{

string s = str;

for (int length=StringLen(str)-1; length>=0; length--)

{

int tchar = StringGetChar(s, length);

if((tchar > 96 && tchar 223 && tchar < 256))

s = StringSetChar(s, length, tchar - 32);

else if(tchar > -33 && tchar < 0)

s = StringSetChar(s, length, tchar + 224);

}

return(s);

}

//------------------------------------------------------------------

//

//------------------------------------------------------------------

//

//

//

//

//

 
mrtools:
Hi Jozy, think you forgot to post the indicator.

I am very sorry! This is the indicator:

Files:
 

mr tools or mladen,

could you please make this indicator to MTF?

best regards,

marko

 

hi,

i have this indicator Fantail and it would be great if you could it make it to be MTF?

thank you on your help

Files:
 
Jozy:
Mr Mladen, or Mrtools, could we have some alerts on this indicator? On zero cross and colour change?

Thanks

Jozy

Jozy, added options for alerts on color/slope change and or for zero cross.

 
split15:
hi,

i have this indicator Fantail and it would be great if you could it make it to be MTF?

thank you on your help

Hi Split15, added mtf.

Files:
 

Someone help out with a OSMA MTF indicator for MT4?

Reason: