本文整理汇总了C#中StockSharp.Algo.Candles.CandleSeries.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# CandleSeries.ToString方法的具体用法?C# CandleSeries.ToString怎么用?C# CandleSeries.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StockSharp.Algo.Candles.CandleSeries
的用法示例。
在下文中一共展示了CandleSeries.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ChartWindow
public ChartWindow(CandleSeries candleSeries, DateTime from, DateTime to)
{
InitializeComponent();
if (candleSeries == null)
throw new ArgumentNullException(nameof(candleSeries));
_candleSeries = candleSeries;
_trader = MainWindow.Instance.Trader;
Chart.ChartTheme = "ExpressionDark";
var area = new ChartArea();
Chart.Areas.Add(area);
_candleElem = new ChartCandleElement
{
Antialiasing = false,
UpFillColor = Colors.White,
UpBorderColor = Colors.Black,
DownFillColor = Colors.Black,
DownBorderColor = Colors.Black,
};
area.Elements.Add(_candleElem);
_trader.NewCandles += ProcessNewCandles;
_trader.SubscribeCandles(_candleSeries, from, to);
Title = candleSeries.ToString();
}
示例2: Main
static void Main(string[] args)
{
_candleManager = new CandleManager();
if (!GetSetings())
return;
var storageRegistry = new StorageRegistry();
((LocalMarketDataDrive)storageRegistry.DefaultDrive).Path = _historyPath;
var cbs = new TradeStorageCandleBuilderSource { StorageRegistry = storageRegistry };
_candleManager.Sources.OfType<TimeFrameCandleBuilder>().Single().Sources.Add(cbs);
_candleManager.Processing += GetCandles;
foreach (var Sec in listOfName)
{
foreach (var timeFrame in listOfTimeFrame)
{
_series = new CandleSeries(typeof(TimeFrameCandle), Sec, timeFrame);
LisfStreamWriters.Add(_series.ToString(), new StreamWriter(GetFileName(_series), false));
_candleManager.Start(_series, _startTime, _endTime);
}
}
Console.ReadKey();
// Закроем все потоки которые мы записывали
foreach (var strim in LisfStreamWriters)
{
strim.Value.Close();
}
}
示例3: HistoryCandlesClick
private void HistoryCandlesClick(object sender, RoutedEventArgs e)
{
var series = new CandleSeries
{
CandleType = typeof(TimeFrameCandle),
Security = SelectedSecurity,
Arg = CandlesPeriods.SelectedItem,
};
var wnd = new CandlesWindow { Title = series.ToString() };
_сandles.Add(series, wnd);
Trader.SubscribeCandles(series, DateTime.Today.Subtract(TimeSpan.FromTicks(((TimeSpan)series.Arg).Ticks * 30)), DateTime.Now);
wnd.Show();
}
示例4: GetCandles
private static void GetCandles(CandleSeries series, Candle candle)
{
if (candle.State == CandleStates.Finished)
{
LisfStreamWriters[series.ToString()].WriteLine(candle.OpenTime.Date.ToString("d") + " " + candle.OpenTime.DateTime.ToString("T") +
" " + candle.OpenPrice.ToString()+ " "+ candle.HighPrice.ToString() +" "+
candle.LowPrice.ToString() +" "+candle.ClosePrice.ToString() +" "+candle.TotalVolume.ToString());
Console.Write(".");
}
}
示例5: GetFileName
private static string GetFileName(CandleSeries candleSeries)
{
// [email protected]_00-30-00
TimeSpan temp = (TimeSpan) candleSeries.Arg;
string fullPath = _Path + temp.ToString("hhmmss");
if (!Directory.Exists(fullPath))
{
Directory.CreateDirectory(fullPath);
}
return fullPath + @"\"+ candleSeries.ToString().Replace("TimeFrameCandle_","") + ".txt";
}