AW Symbol Watermark ctrader free

by ma.norouzifar in category Trend at 12/09/2022
Description

Adds a watermark to the chart background displaying symol name and description and timeframe with options( color, font, alignment, opacity, show description)

 

watermark

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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using cAlgo.API;
using cAlgo.API.Collections;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;

namespace cAlgo
{
    //V 1.0 
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AutoRescale = false,AccessRights = AccessRights.None)]
    public class AWSymbolWatermarkctrader : Indicator
    {
        //[Parameter(DefaultValue = "Hello world!")]
        //public string Message { get; set; }
        
        //symbol watermark parameter
        [Parameter("Font size", DefaultValue = 18, MinValue = 1, MaxValue = 999)]
        public int FontSize { get; set; }
 
        [Parameter("Font weight", DefaultValue = 7)]
        public FontWeight FontWeight { get; set; }
 
        [Parameter("color", DefaultValue = "#FF7F50")]
        public string ForegroundColor { get; set; }
        
        [Parameter("VerticalAlignment", DefaultValue = VerticalAlignment.Top)]
        public VerticalAlignment  VerticalAlignment { get; set; }
        
        [Parameter("HorizontalAlignment", DefaultValue = HorizontalAlignment.Center)]
        public HorizontalAlignment  HorizontalAlignment { get; set; }
        
        [Parameter("Opacity", DefaultValue = 1)]
        public double  TextOpacity { get; set; }
        
        [Parameter("Show Description", DefaultValue = true)]
        public bool IsDescription { get; set; }
        //[Output("Main")]
       // public IndicatorDataSeries Result { get; set; }

        protected override void Initialize()
        {
            // To learn more about cTrader Automate visit our Help Center:
            // https://help.ctrader.com/ctrader-automate

            DrawWatermark();
        }

        public override void Calculate(int index)
        {
            // Calculate value at specified index
            // Result[index] = 
        }
        
        private void DrawWatermark()
        {
            var symbol = Symbols.GetSymbol(SymbolName);
            var text = string.Format("{0}, {1}",Symbol.Name+'('+symbol.Description+')', TimeFrame);
            if(!IsDescription)
            {
                text = string.Format("{0}, {1}",Symbol.Name, TimeFrame);
            }
            var textBlock = new TextBlock 
            {
                VerticalAlignment = VerticalAlignment,
                HorizontalAlignment = HorizontalAlignment,
                Text = text,
                ForegroundColor = ForegroundColor,
                FontSize = FontSize,
                FontWeight = FontWeight,
                Opacity = TextOpacity,
                IsHitTestVisible = false
            };
            Chart.AddControl(textBlock);
        }
    }
}
Comments

junealexis001 - September 12, 2022 @ 11:50

Awesome post i love it keep posting more!  https://housepaintersportlandor.com

mikle.jk2009 - September 20, 2022 @ 15:40

Hello. It's much easier than you think, because there is a good service that can write the best essay for you. Here is the link to essay writer. I really like working with them because they guarantee quality.

gemma140622 - November 28, 2022 @ 11:31

Page and invite you to stay informed on news. Additionally, send us fresh content so we can read it constantly For accurate tracking happy wheels.

0