using System.Collections.Generic;
using System.ComponentModel;
using System.Xml.Serialization;
using TradersYardX.Custom;
using TradersYardX.Plugins;
using TradersYardX.Helper;
namespace TradersYardX.UserCode
[Description("Multibar Demo")]
// The indicator requires daily and weekly data
[TimeFrameRequirements("1 Day", "1 Week")]
public class MultiBarDemo : UserIndicator
private static readonly TimeFrame TF_Day = new TimeFrame(DatafeedHistoryPeriodicity.Day, 1);
private static readonly TimeFrame TF_Week = new TimeFrame(DatafeedHistoryPeriodicity.Week, 1);
protected override void OnBarsRequirements()
protected override void OnInit()
CalculateOnClosedBar = true;
protected override void OnCalculate()
// The current value for the SMA 14 in the timeframe of the chart
Print("TF0: " + SMA(Closes[0], 14)[0]);
// The current value for the SMA 14 in a daily timeframe
Print("TF1: " + SMA(Closes[1], 14)[0]);
// Current value for the SMA 14 in a weekly timeframe
Print("TF2: " + SMA(Closes[2], 14)[0]);