Your interactive trading laboratory!
 • 
24 users online

Quantacula Help

How-To
C# API Reference
Extensions
Development Blog
API-Extensions
Indicator Spotlights

QCommunity Extensions
The open-source GitHub repository of source code for the QCommunity Extensions library. Contains indicators and other extensions submitted by the Quantacula Community. Look for QCommunity indicators when you create a Building Block model, mark the "QCommunity" library check box to expose them.

TASC-Extensions
The open-source GitHub repository of source code for the TASCExtensions Quantacula extension. Contains indicators and other extensions adapted from the Traders' Tips articles in Technical Analysis of Stocks & Commodities magazine.
BarHistory
Namespace: Quantacula.Core
Parent: TimeSeriesBase

The BarHistory class represents historical price and volume data for a market. When you work with code-based Models, you're passed an instance of a BarHistory object in the Initialize, Execute, and other methods. This instance contains the historical data your Model should backtest.

A "bar" of data contains an open price, a high, low and closing price. The BarHistory class exposes these through Open, High, Low, and Close properties, each of which is an instance of the TimeSeries class. Volume information is available via the Volume property, also a TimeSeries instance. Use the DateTimes property to access the list of DateTimes that these time series are keyed off of.

Alternate Price Components

AveragePriceHL
public TimeSeries AveragePriceHL

Calculates and returns the average price TimeSeries (high + low) / 2.

Example Code
using Quantacula.Backtest;
using System;
using Quantacula.Core;
using Quantacula.Indicators;
using Quantacula.ChartWPF;
using System.Drawing;
using System.Collections.Generic;

namespace Quantacula
{
    public class MyModel : UserModelBase
    {
        //plot the average price, both versions
        public override void Initialize(BarHistory bars)
        {
			Plot(bars.AveragePriceHL, "Average Price", Color.Blue, PlotStyles.Line, "Price");
	        Plot(bars.AveragePriceHLC, "Average Price w/Close", Color.Red, PlotStyles.Line, "Price");
        }

        public override void Execute(BarHistory bars, int idx)
        {
        }
    }
}

AveragePriceHLC
public TimeSeries AveragePriceHLC

Calculates and returns the average price TimeSeries (high + low + close) / 3.

Example Code
using Quantacula.Backtest;
using System;
using Quantacula.Core;
using Quantacula.Indicators;
using Quantacula.ChartWPF;
using System.Drawing;
using System.Collections.Generic;

namespace Quantacula
{
    public class MyModel : UserModelBase
    {
        //plot the average price, both versions
        public override void Initialize(BarHistory bars)
        {
			Plot(bars.AveragePriceHL, "Average Price", Color.Blue, PlotStyles.Line, "Price");
	        Plot(bars.AveragePriceHLC, "Average Price w/Close", Color.Red, PlotStyles.Line, "Price");
        }

        public override void Execute(BarHistory bars, int idx)
        {
        }
    }
}

AveragePriceHLCC
public TimeSeries AveragePriceHLCC

Calculates and returns the average price TimeSeries (high + low + close + close) / 4.


AveragePriceOC
public TimeSeries AveragePriceOC

Calculates and returns the average price TimeSeries (open + close) / 2.


AveragePriceOHLC
public TimeSeries AveragePriceOHLC

Calculates and returns the average price TimeSeries (open + high + low + close) / 4.



Fundamental Data

Fundamentals
public List<FundamentalDataPoint> Fundamentals

Returns a list of FundamentalDataPoint instances that represents the fundamental data that has been loaded along with the historical data.

Example Code
using Quantacula.Backtest;
using System;
using Quantacula.Core;
using Quantacula.Indicators;
using Quantacula.ChartWPF;
using System.Drawing;
using System.Collections.Generic;

namespace Quantacula
{
    public class MyModel : UserModelBase
    {
        //report last fundamental item
        public override void Initialize(BarHistory bars)
        {
	        if (bars.Fundamentals.Count == 0)
				return;
			FundamentalDataPoint fdp = bars.Fundamentals[bars.Fundamentals.Count - 1];
			DrawHeaderText("Most recent fundamental data occurred on " + fdp.Date.ToShortDateString());
			DrawHeaderText("It was of type \"" + fdp.Name + "\" with a value of " + fdp.Value.ToString("N2"));
        }

        public override void Execute(BarHistory bars, int idx)
        {
        }
    }
}

GetFundamentals
public List<FundamentalDataPoint> GetFundamentals(string name)

Returns a list of FundamentalDataPoint instances for the fundamental data specified in the name parameter.



Futures Mode

FuturesMode
public bool FuturesMode

Set by the backtester, returns true if Futures Mode was enabled for this backtest.


Margin
public double Margin

The amount of capital required to open a 1 share/contract position. In Futures Mode, the backtester uses Margin to determine the position's cost basis.


PointValue
public double PointValue

The point value for each 1 point move of the share/contract. In Futures Mode, the backtester multiplies a position's profit by PointValue.


TickSize
public double TickSize

The minimum resolution for a position's quantity. In Futures Mode, the backtester adjusts a position's quantity based on TickSize.



Members

Add
public int Add(DateTime dt, double o, double h, double l, double c, double v)

Allows you to add an datetime/open/high/low/close/volume group of values to this BarHistory. Normally you won't need to directly add values to a BarHistory. This method is most useful in the development of custom Historical Data Source extensions.


Cache
public Dictionary<string, object> Cache

A generic cache Dictionary that can be used to store objects during a backtest run. Certain indicators such as ADX, ADXR, DIPlus and DIMinus use the Cache to store the collection of indicators that are all calculated together as a group.

Example Code
using Quantacula.Backtest;
using System;
using Quantacula.Core;
using Quantacula.Indicators;
using Quantacula.ChartWPF;
using System.Drawing;
using System.Collections.Generic;

namespace Quantacula
{
	public class MyModel : UserModelBase
	{
		//the list of symbols that we should buy each bar
		private static List<BarHistory> buys = new List<BarHistory>();

		//create the weight indicator and stash it into the BarHistory object for reference in PreExecute
		public override void Initialize(BarHistory bars)
		{
			rsi = new RSI(bars.Close, 14);
			//store the RSI indicator in the cache, so it can be accessed when PreExecute is called
			bars.Cache["RSI"] = rsi;
		}

		//this is called prior to the Execute loop, determine which symbols have the lowest RSI
		public override void PreExecute(DateTime dt, List<BarHistory> participants)
		{
			//store the symbols' RSI value in their BarHistory instances
			foreach (BarHistory bh in participants)
			{
				RSI rsi = (RSI)bh.Cache["RSI"];
				int idx = GetCurrentIndex(bh);  //this returns the index of the BarHistory for the bar currently being processed
				double rsiVal = rsi[idx];
				bh.UserData = rsiVal; //save the current RSI value along with the BarHistory instance
			}

			//sort the participants by RSI value (lowest to highest)
			participants.Sort((a, b) => a.UserDataAsDouble.CompareTo(b.UserDataAsDouble));

			//keep the top 3 symbols
			buys.Clear();
			for (int n = 0; n < 3; n++)
			{
				if (n >= participants.Count)
					break;
				buys.Add(participants[n]);
			}
		}

		//execute the strategy rules here, this is executed once for each bar in the backtest history
		public override void Execute(BarHistory bars, int idx)
		{
			bool inBuyList = buys.Contains(bars);
			if (!HasOpenPosition(bars, PositionType.Long))
			{
				//buy logic - buy if it's in the buys list
				if (inBuyList)
					PlaceTrade(bars, TransactionType.Buy, OrderType.Market);
			}
			else
			{
				//sell logic, sell if it's not in the buys list
				if (!inBuyList)
					PlaceTrade(bars, TransactionType.Sell, OrderType.Market);
			}
		}

		//declare private variables below
		private RSI rsi;
	}
}

Close
public TimeSeries Close

Returns a TimeSeries that represents the closing prices.

Example Code
using Quantacula.Backtest;
using System;
using Quantacula.Core;
using Quantacula.Indicators;
using Quantacula.ChartWPF;
using System.Drawing;
using System.Collections.Generic;

namespace Quantacula
{
    public class MyModel : UserModelBase
    {
        //display information about the most recent trading day
        public override void Initialize(BarHistory bars)
        {
			DrawHeaderText("Closing price for the most recent trading day was: $" + bars.Close[bars.Count - 1].ToString("N2"));
        }

        public override void Execute(BarHistory bars, int idx)
        {
        }
    }
}

Count
public int Count

Returns the number of items contained in the time series. The DateTimes property list contains this many DateTimes. For TimeSeries, the Values property contains this many values. And for BarHistory, the Open, High, Low, Close and Volume properties (all instances of the TimeSeries class) contain this many values.

Example Code
using Quantacula.Backtest;
using System;
using Quantacula.Core;
using Quantacula.Indicators;
using Quantacula.ChartWPF;
using System.Drawing;
using System.Collections.Generic;

namespace Quantacula
{
	public class MyModel : UserModelBase
	{
		//do some analysis of 10, 20, 50, 100 bars ago
		public override void Initialize(BarHistory bars)
		{
			SetTextDrawingOptions(Color.Beige, Color.Black, 1);
			ReportGainAfterNBars(bars, 10);
			ReportGainAfterNBars(bars, 20);
			ReportGainAfterNBars(bars, 50);
			ReportGainAfterNBars(bars, 100);
		}
		private void ReportGainAfterNBars(BarHistory bars, int numBars)
		{
			int idx = bars.Count - numBars;
			if (idx >= 0)
			{
				double gain = bars.Close[bars.Count - 1] - bars.Close[idx];
				gain = gain * 100.0 / bars.Close[idx];
				DrawBarAnnotation(numBars + " bar gain: " + gain.ToString("N2") + "%", idx, false, Color.Black, 7);
				DrawLine(idx, bars.Close[idx], bars.Count - 1, bars.Close[bars.Count - 1], Color.Gray, LineStyles.Dotted);
			}
		}

		public override void Execute(BarHistory bars, int idx)
		{
		}
	}
}

DateTimes
public virtual List<DateTime> DateTimes

A list of DateTime objects that represents the date/time of each item in the time series. The derived classes maintain other lists that are synchronized with DateTimes. TimeSeries maintains a list of floating point double Values. BarHistory has TimeSeries properties for Open, High, Low, Close, and Volume. All of these other lists will have exactly the same number of elements as the DateTImes list, allowing you to use the same index to access their elements interchangably.

Example Code
using Quantacula.Backtest;
using System;
using Quantacula.Core;
using Quantacula.Indicators;
using Quantacula.ChartWPF;
using System.Drawing;
using System.Collections.Generic;

namespace Quantacula
{
    public class MyModel : UserModelBase
    {
        //annotate the 100 bar high and low
        public override void Initialize(BarHistory bars)
        {
			double lowVal = Double.MaxValue;
			double highVal = Double.MinValue;
			int lowIdx = -1;
			int highIdx = -1;
			for (int n = bars.Count - 1; n > bars.Count - 100; n--)
			{
				if (n >= 0)
				{
					if (bars.Low[n] < lowVal)
					{
						lowVal = bars.Low[n];
						lowIdx = n;
					}
					if (bars.High[n] > highVal)
					{
						highVal = bars.High[n];
						highIdx = n;
					}
				}
			}
			if (lowIdx >= 0)
			{
				string txt = "100 bar low occurred on " + bars.DateTimes[lowIdx].ToLongDateString();
				DrawBarAnnotation(txt, lowIdx, false, Color.Red, 8);
			}
			if (highIdx >= 0)
			{
				string txt = "100 bar high occurred on " + bars.DateTimes[highIdx].ToLongDateString();
				DrawBarAnnotation(txt, highIdx, true, Color.Green, 8);
			}
        }

        public override void Execute(BarHistory bars, int idx)
        {
        }
    }
}

DisplayDecimals
public int DisplayDecimals

The number of decimals places to use when displaying price data.


EndDate
public DateTime EndDate

Returns the last DateTime in the DateTimes property list. If the list is empty, returns DateTime.MaxValue.

Example Code
using Quantacula.Backtest;
using System;
using Quantacula.Core;
using Quantacula.Indicators;
using Quantacula.ChartWPF;
using System.Drawing;
using System.Collections.Generic;

namespace Quantacula
{
    public class MyModel : UserModelBase
    {
        //create indicators and other objects here, this is executed prior to the main trading loop
        public override void Initialize(BarHistory bars)
        {
			SetTextDrawingOptions(Color.AliceBlue, Color.Black, 1);
			string s = "Chart end date is " + bars.EndDate.ToLongDateString();
			DrawHeaderText(s);   
        }
	    
        public override void Execute(BarHistory bars, int idx)
        {
        }
    }
}

ExtendedBars
public int ExtendedBars

You can assign a value to ExtendedBars to create projected space along the right edge of the chart. The chart is filled with a number of future date/time values equal to the value you assign to ExtendedBars. The projected OHLC/V are assigned Double.NaN.

Example Code
using Quantacula.Backtest;
using System;
using Quantacula.Core;
using Quantacula.Indicators;
using Quantacula.ChartWPF;
using System.Drawing;
using System.Collections.Generic;

namespace Quantacula
{
	public class MyModel : UserModelBase
	{
		//project 20 bar price trend 20 bars into the future
		public override void Initialize(BarHistory bars)
		{
			if (bars.Count < 20)
				return;
			int x1 = bars.Count - 20;
			double y1 = bars.Close[x1];
			int x2 = bars.Count - 1;
			double y2 = bars.Close[x2];
			DrawLine(x1, y1, x2, y2, Color.Teal, LineStyles.Solid, "Price", false, true);
			bars.ExtendedBars = 20;
		}

		public override void Execute(BarHistory bars, int idx)
		{
		}
	}
}

High
public TimeSeries High

Returns a TimeSeries that represents the high prices.

Example Code
using Quantacula.Backtest;
using System;
using Quantacula.Core;
using Quantacula.Indicators;
using Quantacula.ChartWPF;
using System.Drawing;
using System.Collections.Generic;

namespace Quantacula
{
    public class MyModel : UserModelBase
    {
        //display information about the most recent trading day
        public override void Initialize(BarHistory bars)
        {
			DrawHeaderText("High price for the most recent trading day was: $" + bars.High[bars.Count - 1].ToString("N2"));
        }

        public override void Execute(BarHistory bars, int idx)
        {
        }
    }
}

IndexOf
public int IndexOf(DateTime dt, bool exactMatchOnly = false)

Returns the index into the DateTimes property list that contains the DateTime specified in the dt parameter. If exactMatchOnly is false, and an exact match does not exist, the method returns the index following the closest matching DateTime, unless the requested DateTime falls completely outside the range of the list, in which case it returns -1. If exactMatchOnly is true and no exact match exists, the method returns -1.

Example Code
using Quantacula.Backtest;
using System;
using Quantacula.Core;
using Quantacula.Indicators;
using Quantacula.ChartWPF;
using System.Drawing;
using System.Collections.Generic;

namespace Quantacula
{
    public class MyModel : UserModelBase
    {
        //whoever figures out the significance of this date will receive a one month free Premium membership credit
        public override void Initialize(BarHistory bars)
        {
			Color green = Color.FromArgb(128, 0, 255, 0);
	        if (bars.Count == 0)
				return;
			for (int yr = bars.StartDate.Year; yr <= bars.EndDate.Year; yr++)
			{
				DateTime dt = new DateTime(yr, 8, 25);
				int idx = bars.IndexOf(dt);
				if (idx >= 0)
					SetBackgroundColor(idx, green);
			}
        }

        public override void Execute(BarHistory bars, int idx)
        {
        }
    }
}

IsFirstBarOfDay
public bool IsFirstBarOfDay(int idx)

Returns true if the specified index is the first bar of data for the day. Useful for intraday models.

Example Code
using Quantacula.Backtest;
using System;
using Quantacula.Core;
using Quantacula.Indicators;
using Quantacula.ChartWPF;
using System.Drawing;
using System.Collections.Generic;

namespace Quantacula
{
	public class MyModel : UserModelBase
	{
		//visually accent the first and last bars of the trading day
		public override void Execute(BarHistory bars, int idx)
		{
			if (bars.IsFirstBarOfDay(idx))
				SetBackgroundColor(idx, Color.AliceBlue);
			if (bars.IsLastBarOfDay(idx))
				SetBackgroundColor(idx, Color.Beige);
		}
	}
}

IsLastBarOfDay
public bool IsLastBarOfDate(int idx)

Returns true if the specified index is the last bar of data for the day. Useful for intraday models.

Example Code
using Quantacula.Backtest;
using System;
using Quantacula.Core;
using Quantacula.Indicators;
using Quantacula.ChartWPF;
using System.Drawing;
using System.Collections.Generic;

namespace Quantacula
{
	public class MyModel : UserModelBase
	{
		//visually accent the first and last bars of the trading day
		public override void Execute(BarHistory bars, int idx)
		{
			if (bars.IsFirstBarOfDay(idx))
				SetBackgroundColor(idx, Color.AliceBlue);
			if (bars.IsLastBarOfDay(idx))
				SetBackgroundColor(idx, Color.Beige);
		}
	}
}

IsUpToDate
public virtual bool IsUpToDate(DateTime endDate)

Returns whether the historical data appears up to date, as of the DateTime specified in the endDate parameter. The method accounts for weekends, market holidays, and market open and closing times, when called from a BarHistory object.

Example Code
using Quantacula.Backtest;
using System;
using Quantacula.Core;
using Quantacula.Indicators;
using Quantacula.ChartWPF;
using System.Drawing;
using System.Collections.Generic;

namespace Quantacula
{
    public class MyModel : UserModelBase
    {
        //report on whether data needs updating
        public override void Initialize(BarHistory bars)
        {
			string txt;
			Color c;
			if (bars.IsUpToDate(DateTime.Now))
			{
				txt = "Data appears to be up to date";
				c = Color.Green;
			}
			else
			{
				txt = "Data appears to need updating!";
				c = Color.Red;
			}
			DrawHeaderText(txt, c);
        }

        public override void Execute(BarHistory bars, int idx)
        {
        }
    }
}

Low
public TimeSeries Low

Returns a TimeSeries that represents the low prices.

Example Code
using Quantacula.Backtest;
using System;
using Quantacula.Core;
using Quantacula.Indicators;
using Quantacula.ChartWPF;
using System.Drawing;
using System.Collections.Generic;

namespace Quantacula
{
    public class MyModel : UserModelBase
    {
        //display information about the most recent trading day
        public override void Initialize(BarHistory bars)
        {
			DrawHeaderText("Low price for the most recent trading day was: $" + bars.Low[bars.Count - 1].ToString("N2"));
        }

        public override void Execute(BarHistory bars, int idx)
        {
        }
    }
}

Market
public MarketDetails Market

Returns an instance of the MarketDetails class that contains information about the market that the symbol belongs to. This instance is populated by the historical data provider that was used to obtain the data for the symbol.

Example Code
using Quantacula.Backtest;
using System;
using Quantacula.Core;
using Quantacula.Indicators;
using Quantacula.ChartWPF;
using System.Drawing;
using System.Collections.Generic;

namespace Quantacula
{
    public class MyModel : UserModelBase
    {
        //display information about the historical data
        public override void Initialize(BarHistory bars)
        {
			MarketDetails md = bars.Market;
			DrawHeaderText("Trades on the " + md.Name + " market, which operated in the " + md.BaseTimeZone + " zone");
        }

        public override void Execute(BarHistory bars, int idx)
        {
        }
    }
}

Open
public TimeSeries Open

Returns the TimeSeries that represents the open prices.

Example Code
using Quantacula.Backtest;
using System;
using Quantacula.Core;
using Quantacula.Indicators;
using Quantacula.ChartWPF;
using System.Drawing;
using System.Collections.Generic;

namespace Quantacula
{
    public class MyModel : UserModelBase
    {
        //display information about the most recent trading day
        public override void Initialize(BarHistory bars)
        {
			DrawHeaderText("Open price for the most recent trading day was: $" + bars.Open[bars.Count - 1].ToString("N2"));
        }

        public override void Execute(BarHistory bars, int idx)
        {
        }
    }
}

QuantityDecimals
public int QuantityDecimals

The number of decimal places to use when calculating the number of shares/contracts in a position.


RemoveAt
public void RemoveAt(int idx)

Removes the datetime/open/high/low/close/volume values from this BarHistory at the index specified in the idx parameter. You generally won't need to remove bars of data during normal model development.


Scale
public HistoryScale Scale

The scale of the data being represented, as an instance of the HistoryScale class.

Example Code
using Quantacula.Backtest;
using System;
using Quantacula.Core;
using Quantacula.Indicators;
using Quantacula.ChartWPF;
using System.Drawing;
using System.Collections.Generic;

namespace Quantacula
{
    public class MyModel : UserModelBase
    {
        //display information about the historical data
        public override void Initialize(BarHistory bars)
        {
			DrawHeaderText("Symbol " + bars.Symbol + " has " + bars.Count + " bars of " + bars.Scale.Description + " data");
        }

        public override void Execute(BarHistory bars, int idx)
        {
        }
    }
}

SecurityName
public string SecurityName

The security name being represented, if available. For example, "Apple, Inc." for Apple corporation. Not all data sources provide a security name.

Example Code
using Quantacula.Backtest;
using System;
using Quantacula.Core;
using Quantacula.Indicators;
using Quantacula.ChartWPF;
using System.Drawing;
using System.Collections.Generic;

namespace Quantacula
{
	public class MyModel : UserModelBase
	{
		//display information about the historical data
		public override void Initialize(BarHistory bars)
		{
			string name = bars.SecurityName == "" ? bars.Symbol : bars.SecurityName;
			DrawHeaderText(name + " has " + bars.Count + " bars of data");
		}

		public override void Execute(BarHistory bars, int idx)
		{
		}
	}
}

StartDate
public DateTime StartDate

Returns the first DateTime in the DateTimes property list. If the list is empty, returns DateTime.MinValue.

Example Code
using Quantacula.Backtest;
using System;
using Quantacula.Core;
using Quantacula.Indicators;
using Quantacula.ChartWPF;
using System.Drawing;
using System.Collections.Generic;

namespace Quantacula
{
    public class MyModel : UserModelBase
    {
        //create indicators and other objects here, this is executed prior to the main trading loop
        public override void Initialize(BarHistory bars)
        {
			SetTextDrawingOptions(Color.AliceBlue, Color.Black, 1);
			string s = "Chart start date is " + bars.StartDate.ToLongDateString();
			DrawHeaderText(s);   
        }
	    
        public override void Execute(BarHistory bars, int idx)
        {
        }
    }
}

Symbol
public string Symbol

The symbol being represented. For example, "MSFT" for Microsoft Corporation stock.

Example Code
using Quantacula.Backtest;
using System;
using Quantacula.Core;
using Quantacula.Indicators;
using Quantacula.ChartWPF;
using System.Drawing;
using System.Collections.Generic;

namespace Quantacula
{
    public class MyModel : UserModelBase
    {
        //display information about the historical data
        public override void Initialize(BarHistory bars)
        {
			DrawHeaderText("Symbol " + bars.Symbol + " has " + bars.Count + " bars of data");
        }

        public override void Execute(BarHistory bars, int idx)
        {
        }
    }
}

TimeSpan
public TimeSpan TimeSpan

Returns a TimeSpan that encompasses the range of the DateTimes in the DateTimes property list. If there are fewer than two DateTimes in the list, returns a zero TimeSpan.

Example Code
using Quantacula.Backtest;
using System;
using Quantacula.Core;
using Quantacula.Indicators;
using Quantacula.ChartWPF;
using System.Drawing;
using System.Collections.Generic;

namespace Quantacula
{
    public class MyModel : UserModelBase
    {
        //display total amount of time covered in chart
        public override void Initialize(BarHistory bars)
        {
			string txt = "Chart data comprised of " + bars.TimeSpan.TotalHours.ToString("N0") + " total hours";
			DrawHeaderText(txt);
        }

        public override void Execute(BarHistory bars, int idx)
        {
        }
    }
}

UserData
public object UserData

Allows you to store ad-hoc data in a property of a BarHistory or TimeSeries instance. You can store object instances, or primitive values like ints or doubles.


UserDataAsDouble
public double UserDataAsInt

Allows you to access a value you stored in a BarHistory or TimeSeries UserData property as a double.


UserDataAsInt
public int UserDataAsInt

Allows you to access a value you stored in a BarHistory or TimeSeries UserData property as an int.


Volume
public TimeSeries Volume

Returns a TimeSeries that represents the volume data.

Example Code
using Quantacula.Backtest;
using System;
using Quantacula.Core;
using Quantacula.Indicators;
using Quantacula.ChartWPF;
using System.Drawing;
using System.Collections.Generic;

namespace Quantacula
{
    public class MyModel : UserModelBase
    {
        //display information about the most recent trading day
        public override void Initialize(BarHistory bars)
        {
			DrawHeaderText("Volume  for the most recent trading day was: " + bars.Volume[bars.Count - 1].ToString("N2"));
        }

        public override void Execute(BarHistory bars, int idx)
        {
        }
    }
}