Announcement

Collapse
No announcement yet.

Color code time on advanced chart

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Color code time on advanced chart

    Hi,
    I trade Forex, hence my charting analysis is timezone sensitive.

    I would like to color code the background color of price chart on 'advanced chart' based on time - for example.

    On a 24 hours chart (Forex trading hours, trading time)

    New York open 8:00 am to 5:00 pm EST -- Blue
    Tokyo open 7:00 pm to 4:00 am EST -- Yelllow
    Sydney open 5:00 pm to 2:00 am EST -- Green
    London open 3:00 am to 12:00 noon EST -- Grey

    do not worry about the overlapping times, this is just an example. If you could jsut direct me to how I can achieve this, I'll work on it to suit the color and overlap issues myself.

    If there a EFS that is already available that does this functions ? Or any toher functions built-in to esignal that would be very helpful.

    Note : I just want the background to be color coded, not the actual price bar/candle.

    Thanks for your help in adavance, Utrader !!

  • #2
    Re: Color code time on advanced chart

    utrader1
    What you need to do is create the conditions based on those times and color the background as necessary eg
    PHP Code:
    if((hour(0)*100)+minute(0)>=800 && (hour(0)*100)+minute(0)<1700){
        
    setBarBgColor(Color.blue);
        } 
    If the time span is within the same day you will need to use && ie AND in between the start and end times.
    If instead the hours cross midninght you will need to use || ie OR eg
    PHP Code:
    if((hour(0)*100)+minute(0)>=1700 || (hour(0)*100)+minute(0)<800){
        
    setBarBgColor(Color.blue);
        } 
    Try also searching the forums because I recall seeing an efs that colored the background based on certain times
    Alex


    Originally posted by utrader1
    Hi,
    I trade Forex, hence my charting analysis is timezone sensitive.

    I would like to color code the background color of price chart on 'advanced chart' based on time - for example.

    On a 24 hours chart (Forex trading hours, trading time)

    New York open 8:00 am to 5:00 pm EST -- Blue
    Tokyo open 7:00 pm to 4:00 am EST -- Yelllow
    Sydney open 5:00 pm to 2:00 am EST -- Green
    London open 3:00 am to 12:00 noon EST -- Grey

    do not worry about the overlapping times, this is just an example. If you could jsut direct me to how I can achieve this, I'll work on it to suit the color and overlap issues myself.

    If there a EFS that is already available that does this functions ? Or any toher functions built-in to esignal that would be very helpful.

    Note : I just want the background to be color coded, not the actual price bar/candle.

    Thanks for your help in adavance, Utrader !!

    Comment


    • #3
      Thank you Alex. I got it working - it turns out it is quite straigth forward using EFS Formaula wizard.

      thanks for your response !!

      Utrader.

      Comment


      • #4
        Utrader
        You are welcome and I am glad to hear you got it to work
        Alex


        Originally posted by utrader1
        Thank you Alex. I got it working - it turns out it is quite straigth forward using EFS Formaula wizard.

        thanks for your response !!

        Utrader.

        Comment

        Working...
        X