INTRADAY DILATATION FACTOR

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #50014 quote
    Leo
    Participant
    Veteran

    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

    //INTRADAY DILATATION FACTOR
    
    //Kd1=0.7 //smallest dilatation factor
    //Kd2=1 //highest dilatation factor
    //minutesbar=1 //time frame in minutes
    
    //  --> Senosoidal Dilatation factor
    IF INTRADAYBARINDEX < 345/minutesbar THEN
     Kd=Kd2
    ELSIF INTRADAYBARINDEX>1125/minutesbar THEN
     Kd=Kd2
    ELSE
     Kd=(Kd1+Kd2)/2+((Kd1-Kd2)/2)*COS((INTRADAYBARINDEX-540/minutesbar)/(735/minutesbar-540/minutesbar)*180)
    ENDIF
    
    Return Kd as "Intraday Dilatation Factor"
    #50108 quote
    Nicolas
    Keymaster
    Master

    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:

    once NbBar = 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
    
    return 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?

    #50151 quote
    Leo
    Participant
    Veteran

    Hi 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!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

INTRADAY DILATATION FACTOR


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Leo @leito Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Leo
8 years, 3 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 10/21/2017
Status: Active
Attachments: 1 files
Logo Logo
Loading...