分类
最佳加密货币交易所

趋势线(Trend Line)

C# 给PPT中的图表添加趋势线

支持趋势线的图表类型包括二维面积图、条形图、柱形图、柱形图、股价图、xy (散点图) 和气泡图中;不能向三维、堆积、雷达图、饼图、曲面图或圆环图的数据系列添加趋势线。可添加的趋势线类型包括6种,即多项式(Polynomial)趋势线、指数(Exponential)趋势线、线性(Linear)趋势线、对数(Logarithmic)趋势线、幂(Power)趋势线、移动平均(移动平均)趋势线。下面以柱形图表为例,添加趋势线。方法及步骤参考如下。

【程序环境】

  • Visual Studio 2017
  • .net framework 4.6.1
  • Power Point 2013 (.pptx)
  • PPT类库:Spire.Presentation for .NET

1. 实现方法

通过调用Spire.Presentation.dll中Itrendline接口提供的方法AddTrendLine(TrendlinesType type)来添加趋势线,编辑代码前,请先按照如下第2点中的方法在程序中添加引用Spire.Presentation.dll。

2. 关于PPT类库安装:可直接通过Nuget搜索安装到程序。具体方法如下:

C# 给PPT中的图表添加趋势线

chinaherolts2008 于 2022-03-25 22:趋势线(Trend Line) 43:30 发布 174 收藏

支持趋势线的图表类型包括二维面积图、条形图、柱形图、柱形图、股价图、xy (散点图) 和气泡图中;不能向三维、堆积、雷达图、饼图、曲面图或圆环图的数据系列添加趋势线。可添加的趋势线类型包括6种,即多项式(Polynomial)趋势线、指数(Exponential)趋势线、线性(Linear)趋势线、对数(Logarithmic)趋势线、幂(Power)趋势线、移动平均(移动平均)趋势线。下面以柱形图表为例,添加趋势线。方法及步骤参考如下。

【程序环境】

  • Visual Studio 2017
  • .net framework 4.6.1
  • Power Point 2013 (.pptx)
  • PPT类库:Spire.Presentation for .NET

1. 实现方法

通过调用Spire.Presentation.dll中Itrendline接口提供的方法AddTrendLine(TrendlinesType type)来添加趋势线,编辑代码前,请先按照如下第2点中的方法在程序中添加引用Spire.Presentation.dll。

2. 关于PPT类库安装:可直接通过Nuget搜索安装到程序。具体方法如下:

欢迎订阅 MC 策略网

var0 = TL_New( arr0[var8], arr1[var8], arr2[var8],
arr0[0], arr1[0], arr2[0] ) ;
if var2 = 趋势线(Trend Line) 趋势线(Trend Line) true then
var2 = false ;
var1 = var9 - SwHiStrength ;
TL_SetExtLeft( var0, false ) ;
TL_SetExtRight( var0, true ) ;
if var3 <> 99 then
TL_SetColor( var0, var3 ) ;
if var11 = "ONCLOSE" then
TL_SetAlert( var0, 2 )
else if var11 = "INTRABAR" then
TL_SetAlert( var0, 1 )
else
TL_SetAlert( var0, 0 ) ;
end ;
end ;

condition1 = SwingLowBar( 趋势线(Trend Line) 1, Low, SwLoStrength, SwLoStrength + 1 ) = SwLoStrength ;
if condition1 then
begin
for Value1 = 9 downto 0
begin
arr3[Value1+1] = arr3[Value1] ;
arr4[Value1+1] = arr4[Value1] ;
arr5[Value1+1] = arr5[Value1] ;
end ;


arr3[0] = Date[SwLoStrength] ;
arr4[0] = Time[SwLoStrength] ;
arr5[0] = Low[SwLoStrength] ;


for Value2 = 1 to 10
begin
if arr5[Value2] < arr5[0] then
begin
var8 = Value2 ;
Value2 = 11 ;

if Value2 = 12 then
begin
if var4 >= 0 then
begin
condition1 = var10 and var6 = false ;
if condition1 then
begin
TL_SetEnd( var4, Date, Time, TL_GetValue( var4, Date, Time ) ) ;
TL_SetExtRight( var4, false ) ;
end
else 趋势线(Trend Line) 趋势线(Trend Line) if var10 = false then

TL_Delete( var4 ) ;
end ;

var4 = TL_New( arr3[var8], arr4[var8], arr5[var8],
arr3[0], arr4[0], arr5[0] ) ;
if var6 = true then
var6 = false ;
var5 = var9 - SwLoStrength ;
TL_SetExtLeft( var4, false ) ;
TL_SetExtRight( var4, true ) ;
if var7 <> 99 then
TL_SetColor( var4, var7 ) ;
if var11 = "ONCLOSE" then
TL_SetAlert( var4, 2 )
else if var11 = "INTRABAR" then
TL_SetAlert( var4, 1 )
else 趋势线(Trend Line)
TL_SetAlert( var4, 0 ) ;
end ;
end ;

condition1 = var0 >= 0
and var2 = false
and var9 > var1 + SwHiStrength + BarsPast
and ( Close > TL_GetValue( var0, Date, Time ) )[BarsPast];趋势线(Trend Line)

if condition1
then
begin
TL_SetEnd( var0, Date, Time, TL_GetValue( var0, Date, Time ) ) ;
TL_SetExtRight( var0, false ) ;
var2 = true ;
end ;

condition1 = var4 >= 0
and var6 = false
and var9 > var5 + SwLoStrength + BarsPast
and ( Close < TL_GetValue( var4, Date, Time ) )[BarsPast];

if condition1
then
begin
TL_SetEnd( 趋势线(Trend Line) var4, Date, Time, TL_GetValue( var4, Date, Time ) ) ;
TL_SetExtRight( var4, false ) ;
var6 = true ;
end ;

趋势线(Trend Line)

The Net Storey

Friday, June 15, 2007

Technical Analysis: Trend

趋势的定义 (Definition of Trend)

广义:trend is really 趋势线(Trend Line) nothing more than the general direction in which a security or market is headed.

狭义:Unfortunately, trends are not always easy to see. In other words, defining a trend goes well beyond the obvious. In any given chart, you will probably notice that prices do not tend to move in a straight line in any direction, but rather in a series of highs and lows. In technical analysis, it is the movement of the highs and lows that constitutes a trend. For example, an uptrend is classified as a series of higher highs and higher lows, while a downtrend is one of lower lows and lower highs.

Point 2 in the chart is 趋势线(Trend Line) the first high, which is determined after the price falls from this point. Point 3 is the low that is established as the price falls from the high. For this to remain an uptrend, each successive low must not fall below the previous lowest point or the trend is deemed 趋势线(Trend Line) a reversal.

趋势的种类 (Types of trend)

1. Uptrend (上升趋势) - a series of higher highs and higher lows (即,下一个低要比前一个高还要高,下一个高也要比前一个低还要高)。

2. Downtrend (下降趋势) - a series of lower highs and lower lows (即,下一个低要比前一个低还要低,下一个高也要比前一个高还要低)。

3. Sideways/Horizontal Trends - When there is 趋势线(Trend Line) little movement up or down in the peaks and troughs or simply sideways trend is actually not a trend on its own, but a lack of a well-defined trend in either direction. (不是上升也不是下降的趋势,就是sideways了)。

In any case, the market can really only trend in these three ways: up, down or nowhere.

趋势的性质(The properties of trend)

1. Trend Lengths: long-term trend (longer than a year), intermediate trend (1 to 3 months), short-term trend (less than a month).

A long-term trend is composed of several intermediate trends, which often move against 趋势线(Trend Line) the direction of the major trend. If the major trend is upward and there is a downward correction in price movement followed by a continuation of the uptrend, the correction is considered to be an intermediate trend. The short-term trends are components of both major and intermediate trends.

To help identify long-term trends, weekly charts or daily charts spanning a five-year 趋势线(Trend Line) period are used by chartists to get a better idea of the long-term trend. Daily data charts are best used when analyzing both intermediate and short-term trends.

2. Trendlines (趋势线)趋势线(Trend Line)

A trendline is a simple charting technique that adds a 趋势线(Trend Line) line to a chart to represent the trend in the market 趋势线(Trend Line) or a stock.

An upward trendline is drawn at the lows of an upward trend. This line represents the support the stock has every time it moves from a high to a low. Notice how the price is propped up by this support. This type of trendline helps traders to anticipate the point at which a stock's price will begin moving upwards again.

Similarly, a downward trendline is drawn at the highs of the downward trend. This line represents the resistance level that a stock faces every time the price moves from a low to a high.

3. Channels

A channel, or channel lines, is the addition of two parallel trendlines that act as strong areas of support and resistance. The upper trendline connects a series of highs, while the 趋势线(Trend Line) lower trendline connects a series of lows.

Traders will expect a given security to trade between the two levels of support 趋势线(Trend Line) and resistance until it breaks beyond one of the levels, in which case traders can expect a sharp move in the direction of the break. Along with clearly displaying the trend, channels are mainly used to illustrate important areas of support and resistance.

总结 (Conclusion)

Venus

ps: Content and pictures in this article are excerpted from Investopedia.