Upload indicator to ctdn
Created at 22 Jun 2021, 18:33
Upload indicator to ctdn
22 Jun 2021, 18:33
I want to upload my indicator. i build with source. but when i upload it i got error that file doesn't include source.
//Designed by AcademyWave Student
using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;
namespace cAlgo
{
// This sample indicator shows how to add a text block control on your chart
[Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class AWSpread : Indicator
{
TextBlock tb = new TextBlock();
[Parameter("FontSize", DefaultValue = 12)]
public int FontSize { get; set; }
[Parameter("Space to Corner", DefaultValue = 10)]
public int Margin { get; set; }
[Parameter("Horizental Alignment", DefaultValue = HorizontalAlignment.Right)]
public HorizontalAlignment HAlignment { get; set; }
[Parameter("Vertical Alignment", DefaultValue = VerticalAlignment.Bottom)]
public VerticalAlignment VAlignment { get; set; }
[Parameter("Color", DefaultValue = "Red")]
public string Color1 { get; set; }
protected override void Initialize()
{
}
public override void Calculate(int index)
{
if (IsLastBar)
DisplaySpreadOnChart();
}
public void DisplaySpreadOnChart()
{
var spread = Math.Round(Symbol.Spread / Symbol.PipSize, 2);
string sp = string.Format("{0}", spread);
tb.Text = sp;
tb.FontSize = FontSize;
tb.ForegroundColor = Color1.TrimEnd();
tb.HorizontalAlignment = HAlignment;
tb.VerticalAlignment = VAlignment;
tb.Margin = Margin;
Chart.AddControl(tb);
}
}
}
PanagiotisCharalampous
23 Jun 2021, 08:00
Hi khoshroomahdi,
We will investigate this and come back to you.
Best Regards,
Panagiotis
Join us on Telegram and Facebook
@PanagiotisCharalampous