cTrader
Guide on how to integrate licensing library into indicators and cBots
Adding licensing to your indicator/cBot
using System;
using cAlgo.API;
using PoshTrader.Licensing;
namespace cAlgo
{
[Item(ID, "Sample Indicator", Version = "1.0.0", Author = "John Doe")]
[Indicator(TimeZone = TimeZones.UTC, AccessRights = AccessRights.FullAccess)]
public class SampleIndicator : Indicator
{
private ItemLicense _license;
protected override void Initialize()
{
_license = new ItemLicense(this);
if (!_license.IsValid())
{
throw new Exception("Product license validation failed.");
}
// Put your Initialize logic here
}
public override void Calculate(int index)
{
if (!_license.IsValid())
return;
// Put your Calculate logic here
}
}
}Creating a distribution file
Last updated