Category Other  Published on 07/07/2015

Frankfurt/London Lines

Description

Puts orange-red and red vertical line on open of Frankfurt and London open, works with tick charts.

Description is too short.


using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;

namespace cAlgo
{
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class FrankfurtLondon : Indicator
    {
        // fix for tick charts
        int seen_frankfurt = 0;
        int seen_london = 0;
        
        protected override void Initialize()
        {
        }

        public override void Calculate(int index)
        {
            if (MarketSeries.OpenTime[index].Minute == 0) {
                if (MarketSeries.OpenTime[index].Hour == 6 && seen_frankfurt != MarketSeries.OpenTime[index].Day) {
                    seen_frankfurt = MarketSeries.OpenTime[index].Day;
                    ChartObjects.DrawVerticalLine("Frankfurt Open" + index, index, Colors.OrangeRed, 1);
                }
                if (MarketSeries.OpenTime[index].Hour == 7 && seen_london != MarketSeries.OpenTime[index].Day) {
                    seen_london = MarketSeries.OpenTime[index].Day;
                    ChartObjects.DrawVerticalLine("London Open" + index, index, Colors.Red, 1);
                }
            }
        }
    }
}


bosma's avatar
bosma

Joined on 25.12.2014

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: FrankfurtLondon.algo
  • Rating: 0
  • Installs: 4372
  • Modified: 13/10/2021 09:54
Comments
Log in to add a comment.
NE
nealkaplan · 9 years ago

Hi, Thank you for the indicator. I have my charts set as UTC -8 to correspond to Pacific Standard Time and daylight savings. The indicator is showing up as 22:00 to 23:00. It's my understanding that EU is now an hour later or 1:00am pst. 

How would I adjust the indicator to reflect the new time.

 

ME
MerlinBrasil · 9 years ago

Thanks :)