MaVe-TargetTree

by MaVe in category Other at 07/12/2016
Description

Final Version. This indicator displays the current and the previous D/W/M values as a TargetTree.

Released: 07/12/2016

Latest update: 07/12/2016

Notifications: You can display the D/W/M values individually.

Donate a winning trade with this indicator

PayPal.Me:          paypal.me/MarioVerheye

PayPal email:       mario.verheye@epost.ch

Example:

Download
402 downloads
How to install
Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.
Formula / Source Code
Language: C#
Trading Platform: cAlgocTrader
// This indicator displays the current and the previous D/W/M values as a TargetTree.
// 
// ---- Latest Update: Wednesday7December2016
//                                                  -----------------
//                                                       Author          
//                                                    Mario Verheye
//                                                  -----------------
// Donate a winning trade with this indicator          
// PayPal.Me:          paypal.me/MarioVerheye
// PayPal email:       mario.verheye@epost.ch
//
using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;

namespace cAlgo
{
    [Indicator("MaVe-TargetTree", IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class MaVeTargetTree : Indicator
    {
        [Parameter("Show Daily", DefaultValue = true)]
        public bool ShowDaily { get; set; }
        [Parameter("Show Weekly", DefaultValue = true)]
        public bool ShowWeekly { get; set; }
        [Parameter("Show Monthly", DefaultValue = true)]
        public bool ShowMonthly { get; set; }

        private MarketSeries D_Series;
        private MarketSeries W_Series;
        private MarketSeries M_Series;
// ----- 
        Colors Dc = Colors.DarkBlue;
// ------------------------------------------------------        
        protected override void Initialize()
        {
            D_Series = MarketData.GetSeries(Symbol, TimeFrame.Daily);
            W_Series = MarketData.GetSeries(Symbol, TimeFrame.Weekly);
            M_Series = MarketData.GetSeries(Symbol, TimeFrame.Monthly);
        }
// ------------------------------------------------------
        public override void Calculate(int index)
        {
            ChartObjects.DrawVerticalLine("Tree", index + 1, Dc, 1, LineStyle.Solid);
// ----- Daily  
            if (ShowDaily)
            {
                ChartObjects.DrawText("D Open", "_____ D Open", index + 1, D_Series.Open.Last(0), VerticalAlignment.Top, HorizontalAlignment.Right, Dc);
                ChartObjects.DrawText("D High", "_____ D High", index + 1, D_Series.High.Last(0), VerticalAlignment.Top, HorizontalAlignment.Right, Dc);
                ChartObjects.DrawText("D Low", "_____ D Low", index + 1, D_Series.Low.Last(0), VerticalAlignment.Top, HorizontalAlignment.Right, Dc);
                ChartObjects.DrawText("D Median", "_____ D Median", index + 1, D_Series.Median.Last(0), VerticalAlignment.Top, HorizontalAlignment.Right, Dc);


                ChartObjects.DrawText("pD Open", "Open pD _____", index + 1, D_Series.Open.Last(1), VerticalAlignment.Top, HorizontalAlignment.Left, Dc);
                ChartObjects.DrawText("pD High", "High pD _____", index + 1, D_Series.High.Last(1), VerticalAlignment.Top, HorizontalAlignment.Left, Dc);
                ChartObjects.DrawText("pD Low", "Low pD _____", index + 1, D_Series.Low.Last(1), VerticalAlignment.Top, HorizontalAlignment.Left, Dc);
                ChartObjects.DrawText("pD Close", "Close pD _____", index + 1, D_Series.Close.Last(1), VerticalAlignment.Top, HorizontalAlignment.Left, Dc);
                ChartObjects.DrawText("pD Median", "Median pD _____", index + 1, D_Series.Median.Last(1), VerticalAlignment.Top, HorizontalAlignment.Left, Dc);
            }
// ----- Weekly 
            if (ShowWeekly)
            {
                ChartObjects.DrawText("W Open", "_______________ W Open", index + 1, W_Series.Open.Last(0), VerticalAlignment.Top, HorizontalAlignment.Right, Dc);
                ChartObjects.DrawText("W High", "_______________ W High", index + 1, W_Series.High.Last(0), VerticalAlignment.Top, HorizontalAlignment.Right, Dc);
                ChartObjects.DrawText("W Low", "_______________ W Low", index + 1, W_Series.Low.Last(0), VerticalAlignment.Top, HorizontalAlignment.Right, Dc);
                ChartObjects.DrawText("W Median", "_______________ W Median", index + 1, W_Series.Median.Last(0), VerticalAlignment.Top, HorizontalAlignment.Right, Dc);

                ChartObjects.DrawText("pW Open", "Open pW _______________", index + 1, W_Series.Open.Last(1), VerticalAlignment.Top, HorizontalAlignment.Left, Dc);
                ChartObjects.DrawText("pW High", "High pW _______________", index + 1, W_Series.High.Last(1), VerticalAlignment.Top, HorizontalAlignment.Left, Dc);
                ChartObjects.DrawText("pW Low", "Low pW _______________", index + 1, W_Series.Low.Last(1), VerticalAlignment.Top, HorizontalAlignment.Left, Dc);
                ChartObjects.DrawText("pW Close", " Close pW _______________", index + 1, W_Series.Close.Last(1), VerticalAlignment.Top, HorizontalAlignment.Left, Dc);
                ChartObjects.DrawText("pW Median", "Median pW _______________", index + 1, W_Series.Median.Last(1), VerticalAlignment.Top, HorizontalAlignment.Left, Dc);
            }
// ----- Monthly 
            if (ShowMonthly)
            {
                ChartObjects.DrawText("M Open", "_________________________ M Open", index + 1, M_Series.Open.Last(0), VerticalAlignment.Top, HorizontalAlignment.Right, Dc);
                ChartObjects.DrawText("M High", "_________________________ M High", index + 1, M_Series.High.Last(0), VerticalAlignment.Top, HorizontalAlignment.Right, Dc);
                ChartObjects.DrawText("M Low", "_________________________ M Low", index + 1, M_Series.Low.Last(0), VerticalAlignment.Top, HorizontalAlignment.Right, Dc);
                ChartObjects.DrawText("M Median", "_________________________ M Median", index + 1, M_Series.Median.Last(0), VerticalAlignment.Top, HorizontalAlignment.Right, Dc);

                ChartObjects.DrawText("pM Open", "Open pM _________________________", index + 1, M_Series.Open.Last(1), VerticalAlignment.Top, HorizontalAlignment.Left, Dc);
                ChartObjects.DrawText("pM High", "High pM _________________________", index + 1, M_Series.High.Last(1), VerticalAlignment.Top, HorizontalAlignment.Left, Dc);
                ChartObjects.DrawText("pM Low", "Low pM _________________________", index + 1, M_Series.Low.Last(1), VerticalAlignment.Top, HorizontalAlignment.Left, Dc);
                ChartObjects.DrawText("pM Close", "Close pM _________________________", index + 1, M_Series.Close.Last(1), VerticalAlignment.Top, HorizontalAlignment.Left, Dc);
                ChartObjects.DrawText("pM Median", "Median pM _________________________", index + 1, M_Series.Median.Last(1), VerticalAlignment.Top, HorizontalAlignment.Left, Dc);
            }
        }
    }
}



Comments
0