Indicator very similar to DRS indicator: https://www.mql5.com/en/code/10214
Attached File(s)
JJN-Fibo.mq4
8 KB
|
659 downloads
2
A Simple Mean Reversion Strategy 327 replies
Pairs Trading: Reversion to the Mean 22 replies
Forward test of my new mean reversion strategy 11 replies
Synthetic hedges, cointegration, mean reversion and similar stuff 419 replies
Cointegration, Synthetic hedges, mean reversion in R, Tech Thread 0 replies
DislikedHere is my first variant of the DRS indicator which also has the possibility to show the mentioned atr based projected volatility bands {image} {image} {file}Ignored
DislikedMy friend Jagg showed me this thread and i could not resist. If it's useful i will stay and try to improve it with your all help. You have to option to toggle all at will. Change colors and opacity to fit your needs. {image} {image} {image} 2828209 I will follow this now, so feel free to request improvements. Updated version with better performance while painting all the stuff (sorry for that). {file}Ignored
Disliked{quote} Nice. {quote} Nice. What type of drawing method you use? Initially I wanted to use DRAW_FILLING but unfortunately for some reason I cant make it work in MQL4. (It only works with mql5).Ignored
DislikedHi! I would like to ask about the time GMT+2. I downloaded history data from tickstory without shift of time and put it into MT4 without shift. What i got is that at most of the year the trading week starts at 21:00 and ends at 21:00 and a little part of the year starts and ends at 22:00. and the days monday and friday are partial days- less than 24 hours. When i put the prices in MT4 with shift of 2 hours there is something strange. For H1, at summer the week stats and end at 23:00, and at winter 00:00. But for the daily the day always starts at...Ignored
datetime getEUDSTStart(int year) { // DST starts last sunday in march MqlDateTime mqlDate; mqlDate.year = year; mqlDate.mon = 4; mqlDate.day = 1; mqlDate.hour = 1; // UTC=GMT mqlDate.min = 0; mqlDate.sec = 0; datetime dstStart = StructToTime(mqlDate); int dayDSTStart = TimeDayOfWeek(dstStart); if (dayDSTStart == 0) dayDSTStart = 7; dstStart -= dayDSTStart * PeriodSeconds(PERIOD_D1); return dstStart; } datetime getEUDSTEnd(int year) { // DST ends last sunday in october MqlDateTime mqlDate; mqlDate.year = year; mqlDate.mon = 11; mqlDate.day = 1; mqlDate.hour = 2; // GMT+1=UTC mqlDate.min = 0; mqlDate.sec = 0; datetime dstStart = StructToTime(mqlDate); int dayDSTStart = TimeDayOfWeek(dstStart); if (dayDSTStart == 0) dayDSTStart = 7; dstStart -= dayDSTStart * PeriodSeconds(PERIOD_D1); return dstStart; } datetime getAMDSTStart(int year) { // DST starts 2nd sunday of march MqlDateTime mqlDate; mqlDate.year = year; mqlDate.mon = 3; mqlDate.day = 1; mqlDate.hour = 6; mqlDate.min = 0; mqlDate.sec = 0; datetime dstStart = StructToTime(mqlDate); int dayDSTStart = TimeDayOfWeek(dstStart); if (dayDSTStart != 0) { dayDSTStart = 7 - dayDSTStart; } dstStart += (dayDSTStart + 7) * PeriodSeconds(PERIOD_D1); return dstStart; } datetime getAMDSTEnd(int year) { // switch 1st sunday of november from DST MqlDateTime mqlDate; mqlDate.year = year; mqlDate.mon = 11; mqlDate.day = 1; mqlDate.hour = 7; mqlDate.min = 0; mqlDate.sec = 0; datetime dstEnd = StructToTime(mqlDate); int dayDSTEnd = TimeDayOfWeek(dstEnd); if (dayDSTEnd != 0) { dayDSTEnd = 7 - dayDSTEnd; } dstEnd += dayDSTEnd * PeriodSeconds(PERIOD_D1); return dstEnd; }
Disliked{quote} Some people will argue that this is a classic case of Gambler's fallacy However, I'm not completely convinced about the validity of this theory in the context of trading.Ignored
Disliked{quote} There are only 2 kinds of shift. First brokers with GMT time without shift (very easy because it's the standard). But kkep in mind UTC will be shifted 1 hour when daylight saving is on in europe. The other brokers have GMT+2 to achieve that the "trading week" starts monay 0:00 and end friday 23:59. Then we have the 2 weeks when american daylight saving is already on or still on and europe hasn't daylight saving. Then all brokers shifting 1 hour that the american session of friday ends 23:59 this comes with the problem that the week starting...Ignored
DislikedHi, good job. Is it possible to have the source for the DRS.ex4 Or can someone add a label with the range (0% - 100%) in pips. Thanks ErikIgnored
Disliked{quote} Thanks for your reply. I don't know to read and write code. However, if you calculate from H1, i don't understand why do i get the start of day at 02:00 in your indicator? But i simply deleted the daily data, that shows day start at 02:00, and then your indicator works well. Day start at 0:00. Thanks!Ignored