INTRADAY DILATATION FACTOR
Forums › ProRealTime English forum › ProBuilder support › INTRADAY DILATATION FACTOR
- This topic has 2 replies, 2 voices, and was last updated 7 years ago by Leo.
-
-
10/21/2017 at 9:53 AM #50014
Hi all,
I created a factor which oscillate in a sinusoidal shape. At the moment when the market is more active the value is higher and at night or lunch time the value is minimum (time is in minutes and European time)
In the picture, there is an example where I calculated a Simple Moving Average of 200 periods bud that Period is multiply for the “Intraday Dilatation Factor (Kd)” i.e. mySMA=average[round(200*Kd)](close)
Hope you like it, I used often for example, when I want a better value for my Average True Range or the amplitude of Bollinger Bands
Just share where and do you use this indicator, please.
P.D: Someone knows how to change automatically the variable “minutesbar”? Thanks in advance
12345678910111213141516//INTRADAY DILATATION FACTOR//Kd1=0.7 //smallest dilatation factor//Kd2=1 //highest dilatation factor//minutesbar=1 //time frame in minutes// --> Senosoidal Dilatation factorIF INTRADAYBARINDEX < 345/minutesbar THENKd=Kd2ELSIF INTRADAYBARINDEX>1125/minutesbar THENKd=Kd2ELSEKd=(Kd1+Kd2)/2+((Kd1-Kd2)/2)*COS((INTRADAYBARINDEX-540/minutesbar)/(735/minutesbar-540/minutesbar)*180)ENDIFReturn Kd as "Intraday Dilatation Factor"10/21/2017 at 9:57 AM #50108Hi Leo, thanks for your post. Because I feel it belongs much more to a concept rather than a complete indicator, I moved it into the forum, I hope you don’t mind.
To get how many minutes has a bar in the current timeframe, you can use this code:
1234567891011121314once NbBar = 1//if BarIndex < NbBar+2 thenMyDay=opendaydayminutes = 1440*(MyDay-MyDay[1])MyHour=openhourhourminutes = 60*(MyHour-MyHour[1])MyMin=openminutebarminutes = MyMin - MyMin[1] + hourminutes + dayminutesbarminutes=abs(barminutes)Mybarminutes = lowest[NbBar](barminutes)[1]//endifreturn Mybarminutes as "Timeframe"It is an interesting idea, but how to make sure there is a correlation between the price behavior and the factor, which could be rather different from a day to another?
10/21/2017 at 8:23 PM #50151Hi Nicolas,
I were not even sure where to add this concept.
I just know that at night and after the close of european market things are very quiet as well at lunch time in europe (moments before US open)… it’s like everyone is awaiting for news, macroeconomics data, reports, etc. Therefore I want a tool that “dilatates” all my strategy, indicators, etc. at those moments of the day
… and when I fixed the Kd1=1 and let the variable Kd2 to be optimised between 1 and 1.25, Yes indeed, the strategies work better 🙂
Let us know if you find it useful, thanks!
-
AuthorPosts