[Obsolote] Documentation Image is obsolte
Created at 14 Aug 2024, 15:44
[Obsolote] Documentation Image is obsolte
14 Aug 2024, 15:44
Here (https://help.ctrader.com/ctrader-algo/references/Controls/Image/?h=image#namespace) the second example is using AccessRight which is obsolte in .net 6 and the first example Properties isn't defined
c#
using cAlgo.API;
using System.IO;
namespace cAlgo
{
[Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.FullAccess)]
public class ImageSample : Indicator
{
[Parameter("Image File Path")]
public string ImageFilePath { get; set; }
protected override void Initialize()
{
if (!File.Exists(ImageFilePath))
{
Print($"Image not found: {ImageFilePath}");
return;
}
var imageBytes = File.ReadAllBytes(ImageFilePath);
var image = new Image
{
Source = imageBytes,
Width = 200,
Height = 200,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center
};
Chart.AddControl(image);
}
public override void Calculate(int index)
{
}
}
}
firemyst
17 Oct 2024, 01:45 ( Updated at: 17 Oct 2024, 04:57 )
The example code on this page needs to be updated as well. It's showing example code for “LastValue” under the “Last” property.
It has the same example (correctly) under the LastValue property.
https://help.ctrader.com/ctrader-algo/references/Collections/DataSeries/DataSeries/#last
TO be comprehensive, an updated example should show difference like using “.Last(0)” vs “.Last(1)”
@firemyst