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
Hi 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:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
onceNbBar=1
//if BarIndex < NbBar+2 then
MyDay=openday
dayminutes=1440*(MyDay-MyDay[1])
MyHour=openhour
hourminutes=60*(MyHour-MyHour[1])
MyMin=openminute
barminutes=MyMin-MyMin[1]+hourminutes+dayminutes
barminutes=abs(barminutes)
Mybarminutes=lowest[NbBar](barminutes)[1]
//endif
returnMybarminutesas"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?
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 🙂
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue