當前位置: 首頁>>代碼示例>>C#>>正文


C# BarList類代碼示例

本文整理匯總了C#中BarList的典型用法代碼示例。如果您正苦於以下問題:C# BarList類的具體用法?C# BarList怎麽用?C# BarList使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BarList類屬於命名空間,在下文中一共展示了BarList類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Barlist2Tick

 /// <summary>
 /// create ticks from bars on default interval
 /// </summary>
 /// <param name="bl"></param>
 /// <returns></returns>
 public static Tick[] Barlist2Tick(BarList bl)
 {
     List<Tick> k = new List<Tick>(bl.Count * 4);
     foreach (Bar b in bl)
         k.AddRange(BarImpl.ToTick(b));
     return k.ToArray();
 }
開發者ID:sopnic,項目名稱:larytet-master,代碼行數:12,代碼來源:TikUtil.cs

示例2: NewBarList

 public void NewBarList(BarList barlist)
 {
     chartControl1.NewBarList(barlist);
     Symbol = barlist.Symbol;
     Text = chartControl1.Title;
     Invalidate(true);
 }
開發者ID:antonywu,項目名稱:tradelink,代碼行數:7,代碼來源:Chart.cs

示例3: NewBarList

 public void NewBarList(BarList barlist)
 {
     bl = barlist;
     Symbol = barlist.Symbol;
     Text = Title;
     Invalidate(true);
 }
開發者ID:antonywu,項目名稱:tradelink,代碼行數:7,代碼來源:ChartImpl.cs

示例4: AvgVol

 public decimal AvgVol(BarList bl) // gets the average volume across all bars
 {
     if (!bl.Has(MinimumBarsToAvg,bl.DefaultInterval)) return 0; // if we don't have a bar yet we can't have an avg bar volume
     int sum = 0;
     for (int i = 0; i < bl.Count; i++)
         sum += bl[i].Volume;
     return sum / (bl.Count);
 }
開發者ID:antonywu,項目名稱:tradelink,代碼行數:8,代碼來源:Blade.cs

示例5: BarListImpl

 /// <summary>
 /// make copy of a barlist.  remember you must re-setup GotNewBar events after using this.
 /// </summary>
 /// <param name="original"></param>
 public BarListImpl(BarList original) : this(original.Symbol,original.CustomIntervals,original.Intervals) 
 {
     for (int j = 0; j<original.Intervals.Length; j++)
     {
         original.DefaultInterval = original.Intervals[j];
         for (int i = 0; i < original.Count; i++)
         {
             addbar(this, original[i, original.Intervals[j]], j);
         }
     }
 }
開發者ID:wang-shun,項目名稱:tradelink,代碼行數:15,代碼來源:BarListImpl.cs

示例6: ChartImpl

 /// <summary>
 /// Initializes a new instance of the <see cref="Chart"/> class.
 /// </summary>
 /// <param name="b">The barlist.</param>
 /// <param name="allowtype">if set to <c>true</c> [allowtype] will allow typing/changing of new symbols on the chart window.</param>
 public ChartImpl(BarList b,bool allowtype)
 {
     InitializeComponent();
     Paint += new PaintEventHandler(Chart_Paint);
     MouseWheel +=new MouseEventHandler(Chart_MouseUp);
     if (allowtype) this.KeyUp += new KeyEventHandler(Chart_KeyUp);
     if (b != null)
     {
         bl = b;
         Symbol = b.Symbol;
     }
 }
開發者ID:antonywu,項目名稱:tradelink,代碼行數:17,代碼來源:ChartImpl.cs

示例7: ChartControl

 /// <summary>
 /// Initializes a new instance of the <see cref="Chart"/> class.
 /// </summary>
 /// <param name="b">The barlist.</param>
 /// <param name="allowtype">if set to <c>true</c> [allowtype] will allow typing/changing of new symbols on the chart window.</param>
 public ChartControl(BarList b,bool allowtype)
 {
     InitializeComponent();
     Paint += new PaintEventHandler(Chart_Paint);
     MouseDoubleClick += new MouseEventHandler(ChartControl_MouseDoubleClick);
     MouseWheel +=new MouseEventHandler(Chart_MouseUp);
     if (b != null)
     {
         bl = b;
         Symbol = b.Symbol;
     }
 }
開發者ID:blueysnow,項目名稱:cj-at-project,代碼行數:17,代碼來源:ChartControl.cs

示例8: Chart

 /// <summary>
 /// Initializes a new instance of the <see cref="Chart"/> class.
 /// </summary>
 /// <param name="b">The barlist.</param>
 /// <param name="allowtype">if set to <c>true</c> [allowtype] will allow typing/changing of new symbols on the chart window.</param>
 public Chart(BarList b,bool allowtype)
 {
     InitializeComponent();
     MouseUp +=new MouseEventHandler(chartControl1.Chart_MouseUp);
     MouseWheel += new MouseEventHandler(Chart_MouseUp);
     if (allowtype) this.KeyUp += new KeyEventHandler(Chart_KeyUp);
     if (b != null)
     {
         chartControl1.NewBarList(b);
         Symbol = b.Symbol;
     }
     FormClosing += new FormClosingEventHandler(Chart_FormClosing);
 }
開發者ID:antonywu,項目名稱:tradelink,代碼行數:18,代碼來源:Chart.cs

示例9: newBar

 public bool newBar(BarList bl)
 {
     if (!bl.isValid) return false;
     Bar c = bl.RecentBar;
     if (!c.isValid) return false;
     decimal avgvol = Calc.Avg(bl.Vol());
     decimal moverequired = c.Open * _percent;
     bool voltest = (c.Volume - avgvol) > (avgvol * _bigvolper);
     isBigVolume = (ZeroAvgVolIsBig && voltest) || (!ZeroAvgVolIsBig && (avgvol != 0) && voltest);
     isBladeDOWN = ((c.Open - c.Close) > moverequired);
     isBladeUP = ((c.Close-c.Open) > moverequired);
     pctChange = c.Close / c.Open - 1;
     return true;
 }
開發者ID:antonywu,項目名稱:tradelink,代碼行數:14,代碼來源:Blade.cs

示例10: newTick

 /// <summary>
 /// create bars from ticks
 /// </summary>
 /// <param name="k"></param>
 public void newTick(Tick k)
 {
     if (bl == null)
     {
         Symbol = k.symbol;
         bl = new BarListImpl(k.symbol);
     }
     bl.newTick(k);
     if (k.isTrade)
     {
         if (k.trade > highesth)
             highesth = k.trade;
         if (k.trade < lowestl)
             lowestl = k.trade;
     }
     if (_alwaysupdate)
         redraw();
 }
開發者ID:antonywu,項目名稱:tradelink,代碼行數:22,代碼來源:ChartControl.cs

示例11: newPoint

 /// <summary>
 /// create bars from points
 /// </summary>
 /// <param name="p"></param>
 /// <param name="time"></param>
 /// <param name="date"></param>
 /// <param name="size"></param>
 public void newPoint(string symbol, decimal p, int time, int date, int size)
 {
     if (bl == null)
     {
         Symbol = symbol;
         highesth = SMALLVAL;
         bl = new BarListImpl(symbol);
     }
     bl.newPoint(symbol,p, time, date, size);
     if (p!=0)
     {
         if (p > highesth)
             highesth = p;
         if (p < lowestl)
             lowestl = p;
     }
     if (_alwaysupdate)
         redraw();
 }
開發者ID:antonywu,項目名稱:tradelink,代碼行數:26,代碼來源:ChartControl.cs

示例12: newTick

 /// <summary>
 /// create bars from ticks
 /// </summary>
 /// <param name="k"></param>
 public void newTick(Tick k)
 {
     if (bl == null)
     {
         Symbol = k.symbol;
         bl = new BarListImpl(BarInterval.FiveMin, k.symbol);
     }
     bl.newTick(k);
     if (k.isTrade)
     {
         if (k.trade > highesth)
             highesth = k.trade;
         if (k.trade < lowestl)
             lowestl = k.trade;
     }
     barc = bl.Count;
     if (_alwaysupdate)
         refresh();
 }
開發者ID:antonywu,項目名稱:tradelink,代碼行數:23,代碼來源:ChartControl.cs

示例13: newPoint

 /// <summary>
 /// create bars from points
 /// </summary>
 /// <param name="p"></param>
 /// <param name="time"></param>
 /// <param name="date"></param>
 /// <param name="size"></param>
 public void newPoint(decimal p, int time, int date, int size)
 {
     if (bl == null)
     {
         Symbol = string.Empty;
         highesth = SMALLVAL;
         bl = new BarListImpl(BarInterval.FiveMin, string.Empty);
     }
     bl.newPoint(p, time, date, size);
     if (p!=0)
     {
         if (p > highesth)
             highesth = p;
         if (p < lowestl)
             lowestl = p;
     }
     barc = bl.Count;
     if (_alwaysupdate)
         refresh();
 }
開發者ID:antonywu,項目名稱:tradelink,代碼行數:27,代碼來源:ChartControl.cs

示例14: Lows

 /// <summary>
 /// gets most recent lows from barlist, for certain number of bars
 /// (default is entire list)
 /// </summary>
 /// <param name="chart"></param>
 /// <param name="bars"></param>
 /// <returns></returns>
 public static decimal[] Lows(BarList chart, int bars)
 {
     return EndSlice(chart.Low(), bars);
 }
開發者ID:antonywu,項目名稱:tradelink,代碼行數:11,代碼來源:Calc.cs

示例15: BollingerLower

 /// <summary>
 /// calculates lower bollinger using open (true) or closing (false) prices, at specified # of standard deviations
 /// </summary>
 /// <param name="bl"></param>
 /// <param name="numStdDevs"></param>
 /// <param name="useOpens"></param>
 /// <returns></returns>
 public static decimal BollingerLower(BarList bl, decimal numStdDevs, bool useOpens)
 {
     decimal[] prices = useOpens ? bl.Open() : bl.Close();
     decimal mean = Avg(prices);
     decimal stdev = StdDev(prices);
     return mean - stdev * numStdDevs;
 }
開發者ID:antonywu,項目名稱:tradelink,代碼行數:14,代碼來源:Calc.cs


注:本文中的BarList類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。