compile 3.8 fontsize error

Created at 11 Jun 2020, 13:09
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
GE

genappsforex

Joined 25.11.2019

compile 3.8 fontsize error
11 Jun 2020, 13:09


How to use the FontSize prop?
This won't compile.

Error CS1061: 'cAlgo.API.ChartStaticText' does not contain a definition for 'FontSize' and no extension method 'FontSize' accepting a first argument of type 'cAlgo.API.ChartStaticText' could be found (are you missing a using directive or an assembly reference?)


using System;
using System.Collections.Generic;
using cAlgo.API;
using cAlgo.API.Requests;
using cAlgo.API.Internals;
using System.IO;

namespace cAlgo
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class Test : Robot
    {
        [Parameter("p1", DefaultValue = TradeType.Buy)]
        public TradeType tt { get; set; }

        protected override void OnStart()
        {
            var drt = Chart.DrawText("DRT", "LEFT", (Chart.LastVisibleBarIndex + Chart.FirstVisibleBarIndex) / 2, (Chart.TopY + Chart.BottomY) / 2, "FF666666");
            drt.VerticalAlignment = VerticalAlignment.Top;
            drt.HorizontalAlignment = HorizontalAlignment.Center;
            drt.FontSize = 30;
            drt.IsBold = true;
            drt.ZIndex = 0;

            var drst = Chart.DrawStaticText("DRST", "CENTER", VerticalAlignment.Center, HorizontalAlignment.Center, "FF666666");
            drst.FontSize = 30;
            drst.IsBold = true;
            drst.ZIndex = 0;
        }
    }
}

 


@genappsforex
Replies

PanagiotisCharalampous
11 Jun 2020, 14:07

Hi genappsforex,

As the message indicates cAlgo.API.ChartStaticText doesn't contain these properties. They are only included in cAlgo.API.ChartText.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous