A tutorial on important functions of great wisdom

Source: Internet
Author: User
Tags close close drawtext polyline alphanumeric characters

The use of the sum of the reference function of great wisdom

Function: SUM (x,n) parameter: X is an array, N is the calculation period
Description: Counts the sum of x in the N period, and N=0 begins with the first valid value.
Example: Sum (vol,0) represents the sum of the volumes since the first day of listing.
The sum and count functions differ in that count counts. Sum, total, sum. Notice the difference between the two functions.
When the array is the result of a logical operation, the return value of sum and count is the same. In general, for the logical operation signal, with count statistics, return other values, with sum statistics. When count statistics generally

Value, the array is greater than or equal to 1 o'clock, counted in, less than 1 o'clock, not counted. These two functions are mainly used for statistics.
With Count (Cross (MA (c,5), MA (c,10)), 0), you can count the number of gold forks that wear 10-day averages on all five-day averages.
With Sum (Cross (MA (c,5), MA (c,10)), 0); The result should be the same as above.
See how the following indicator applies the SUM function.
{n:1-m:1 100 34}
Obv:=sum (if (Close>ref (close,1), Vol,if (Close<ref (close,1), 0-vol,0)), 0); <br= "" >ah:= (SUM (h,2) * (SUM (1+winner (h), 2)) *sum (obv,2))/2;
al:= (SUM (l,2) * (SUM (1+winner (L), 2)) *sum (obv,2))/2;
A= (SUM (o,2) * (SUM (1+winner (o), 2)) *sum (obv,2))/2;
ac:= (SUM (c,2) * (SUM (1+winner (c), 2)) *sum (obv,2))/2;
Stickline (ac>=ao,ah,al,0.1,0), colorred; {A solid red bar with a width of 0.1 is drawn between Ah and Al}
Stickline (ac>=ao,ao,ac,4,0), colorred; {A solid red bar with a width of 4 is drawn between AO and AC}
Stickline (ac<ao,ah,al,0.1,0), colorffcc66; {A solid green bar with a width of 0.1 is drawn between Ah and Al} <br= "" >stickline (ac<ao,ao,ac,4,0), colorffcc66; {A solid green bar with 4 width between AO and AC} <br= "" > Two-day reference: Polyline (C>0,ma (ac,2)), colorff00ff;
Ka1:= (HHV (ah,m)-llv (al,m))/m;
Ka2:=sum (ac,n)/n;
M1:ka2-ka1*n,colorwhite;
M2:ka2+ka1*n,colorwhite;
Multi-empty demarcation: (m1+m2)/2,coloryellow;
Indicator Analysis:
{n:1-m:1 100 34}
obv:= Summation (conditional function (Close price > Forward reference (Close price, 1), volume, conditional function (Close price < forward reference (closing price, 1), 0-volume, 0)), 0);
Ah:= (Summation (high price, 2) * (SUM (1+ profit disk ratio (high), 2)) * SUM (obv,2))/2;
al:= (sum (lowest price, 2) * (SUM (1+ profit disk ratio (lowest price), 2)) * SUM (obv,2))/2;
A= (sum (open price, 2) * (SUM (1+ profit disk ratio (open price), 2)) * SUM (obv,2))/2;
ac:= (SUM (closing price, 2) * (Summation (1+ profit-taking ratio (close price), 2)) * Summation (obv,2))/2;
Draw the column line (ac>=ao,ah,al,0.1,0), colorred;
Draw the column line (ac>=ao,ao,ac,4,0), colorred;
Draw the column line (ac<ao,ah,al,0.1,0), colorffcc66; <br= "" > Draw column Line (ac<ao,ao,ac,4,0), colorffcc66; <br= "" > Two-day reference: Draw a polyline (closing price >0, simple moving Average (ac,2)), colorff00ff;
Ka1:= (maximum value (ah,m)-Lowest value (al,m))/m;
Ka2:= summation (ac,n)/n;
M1:ka2-ka1*n,colorwhite;
M2:ka2+ka1*n,colorwhite;
Multi-empty demarcation: (m1+m2)/2,coloryellow;
Here are a few examples of indicators that use the SUM function:
(1), Phase shrinkage
SUM (VOL,N1)/capital<=n2;
Note: The N1 is the phase time to be counted, the N2 is the scale of the contraction, and the parameter range can be set within the parameter setting range.
(2), stage volume
SUM (VOL,N1)/capital>=n2;
Note: N1 is the phase time to be counted, the N2 is the Y volume ratio, and the parameter range can be set within the parameter setting range.
(3), volume on the offensive
A:= (C-ref (c,1))/ref (c,1) >= (n/100);
SUM (VOL,N1)/capital>= (n2/100) and Count (Vol>ref (vol,1), N3) =n3 and Count (a,n3) =n3;
Full meaning: Daily stock price increase is greater than n%,n1 days cumulative turnover rate is greater than n2%, and volume continuously in the N3 intraday amplification.
(4), stage strong shares
A:=sum (if (date-n=0,indexc,0), 0);
B:=sum (if (date-n1=0,indexc,0) 0);
E:=sum (if (date-n=0,c,0), 0);
F:=sum (if (date-n1=0,c,0), 0);
((F-E)/E) > ((b-a)/a);
Note: This formula is for N-day-n1, which is higher than the market share. N, the N1 parameter expression format is YYMMDD, note that 2000 years ago expressed as the last two bits of the year, for example, 1999 is 99, starting from 2000 with 100 in succession, such as September 14, 2001 for the 1010914,INDEXC function to represent the closing price of the same market, This function has no effect on the split deal analysis period.
(5), stage weak shares
A:=sum (if (date=n,indexc,0), 0);
B:=sum (if (date=n1,indexc,0) 0);
E:=sum (if (date=n,c,0), 0);
F:=sum (if (date=n1,c,0), 0);
((F-E)/E) < ((b-a)/a);
Note: This formula is for N-day-n1, which is less than the market share. N, the N1 parameter expression format is YYMMDD, note that 2000 years ago expressed as the last two bits of the year, for example, 1999 is 99, starting from 2000 with 100 in succession, such as September 14, 2001 for the 1010914,INDEXC function to represent the closing price of the same market, This function has no effect on the split deal analysis period.

The application of HHV and LLV for the reference function of great wisdom

Application of reference function HHV and LLV
1, the reference function HHV highest value for the highest value. Usage: HHV (x,n), to find the X highest value in the N period, N=0 starts with the first valid value. For example: HHV (high,30), which represents the highest price for 30th.
2, the reference function llv the lowest value to find the lowest value. Usage: LLV (x,n), to find the X lowest value in the N period, N=0 starts with the first valid value. For example: LLV (low,0), indicating the lowest price of history.
Example 1, such as indicator (main chart)
Cg:=ma (c,18), color00ff00; {18th simple Moving average}
FL:=HHV (cg,3), color00ff00; {Take the highest value of 3rd CG}
FL3:HHV (cg,9), Color00ff00,linethick2; {Take the highest value of 9th CG, draw green thick line}
Fs3:if (Cg<fl3, (cg-(FL3-CG)), fl3), Colorred,linethick2; {The red line is drawn in accordance with the values and conditions in parentheses}.} <br= "" > Example 2, according to the characteristics of the trend of the creation of N days High selection formula:
HHV (high,n) =HHV (high,0) and Barscount (c) >=n;
Note: n is the indicator parameter, which can set the parameter range within the parameter setting range. HHV (X,n), the x highest value in the N period, N=0 starts from the first valid value, Barscount (x), sets the current position to the N period before the number is set to 1, if X is 0, then the current position to the N-period before the value is set to 1. If the n is added to the parameter 30 is 30th within the high innovation.
Example 3, indicator (sub-image)
{Three-wire flowering N:1 100 20}
c0:= (H+L+C)/3;
A1:=HHV (c0,n); A2:=llv (c0,n); a3:=a1-a2;
A4:=ema ((C0-A2)/a3,2) *100;
B1:=HHV (c0,4*n); B2:=llv (c0,4*n); b3:=b1-b2;
B4:=ema ((C0-B2)/b3,2) *100;
C1:=HHV (C0,16*n); C2:=LLV (C0,16*n); C3:=C1-C2;
C4:=ema ((C0-C2)/c3,2) *100;
Short-term relative price: A4,color66d,linethick2;
Mid-term relative price: B4,color6699ff,linethick2;
Long-term relative price: C4,color6600ff,linethick2;
Antenna: 95,linethick2,coloreeee33,pointdot;
Ground: 5,linethick2,color33ee33,pointdot;
Midline: 50,linethick2,coloreeeeee,pointdot;
Indicator Analysis:
{Three-wire flowering N:1 100 20}
c0:= (high price + low price + close price)/3;
a1:= Highest value (c0,n); a2:= Lowest value (c0,n); a3:=a1-a2;
a4:= exponential smoothed Moving Average ((C0-A2)/a3,2) *100;
b1:= Highest value (c0,4*n); b2:= Lowest value (c0,4*n); b3:=b1-b2;
b4:= exponential smoothed Moving Average ((C0-B2)/b3,2) *100;
c1:= Maximum value (c0,16*n); c2:= minimum Value (c0,16*n); C3:=C1-C2;
c4:= exponential smoothed Moving Average ((C0-C2)/c3,2) *100;
Short-term relative price: A4,color66d,linethick2;
Mid-term relative price: B4,color6699ff,linethick2;
Long-term relative price: C4,color6600ff,linethick2;
Antenna: 95,linethick2,coloreeee33, dot-shaped line;
Ground: 5,linethick2,color33ee33, dot-shaped line;
Midline: 50,linethick2,coloreeeeee, dot-shaped line;

Example 4, stock selection index n days Innovation low
LLV (low,n) =llv (low,0) and Barscount (Close) >=n;
Note N is the indicator parameter, which sets the range of parameters within the parameter setting. LLV (X,n), the X lowest value in the N period, N=0 starts from the first valid value, Barscount (x) The first valid data to the current number of days, for example, Barscount (close) The total number of trading days since the listing of the Ryokan line data.
These two functions are widely used in the writing of indicators.
[NextPage]


Introduction and simple application of the big wisdom candlestick function.

Close close this is the closing price of the period;

Highest price High This is the highest price to obtain the period;

Lowest price Low This is the lowest price to obtain the period;

Open Open this is the open price that is obtained for that period;

Volume Vol This is the volume that gets the period;

Turnover amount This is the turnover that is achieved for that period;

A candlestick consists of four prices, close, high, low, open.

Several of these functions can be written in the following simple indicators:

1, close>open means that the closing price of the day is greater than the open price, reflected in the candlestick is the day of the sun, with the indicator selected stocks in the day of the stock selection of the Sun (> is a mathematical greater than the symbol).

2, CLOSE3, close<5 means the closing price is less than 5 yuan, with the index selected stocks are less than 5 yuan of stocks, such as the election of less than 3 yuan of stocks, 5 to 3 on the line. If you choose a stock above 5 yuan, change the < symbol to > OK!

Description of the Candlestick
Yang Line
close>open; {Closing price is greater than open price}
Yin Line
close<open; {Closing price less than opening price} <br= "" > Open
Open>ref (close,1); {Open Price is greater than yesterday's closing price}
Low Open
Open<ref (close,1); {Opening price is less than yesterday's closing price} <br= "" > Jump open Higher (high)
Open>ref (high,1); {Open Price is greater than yesterday's high price}
Low open (lowest price)
Open<ref (low,1); {The open price is less than yesterday's low} <br= "" > The description of the candlestick above uses another function ref, which is a forward-referencing function that refers to data before several cycles.

Usage: REF (x,a), which refers to the X value before the a period. For example: REF (close,1), which represents the closing price of the previous period, is closed on the daily line. Remember, it's often used in the future.

Great wisdom and magical function of drawing

The function of the

Drawing function is to set conditional output icons, lines, text, numbers, indicator lines, indicator bars, and so on on the main or sub-graphs. Using appropriate to make the main sub-graph indicators to give visual aesthetic.
1, Function: DrawIcon
Usage: DrawIcon (cond,price,type), when the COND condition is met, draw the TYPE number icon at the price position.
Description: Draws a small icon on the graph, where type has 3 icons, encoded as 1-3 (1 for Red, 2 for Green, and 3 for flat face).
Example: DrawIcon (close>open,low,1), which indicates that when the sun is closed, draw the 1th icon at the lowest price, which is the red-faced.
DrawIcon (close<open,high,2), indicates that when the yin is in the highest price position to draw the number 2nd icon, that is, green face. <br= "" > Indicator Example:
{Monthly average line main chart}
Ma1:ma (close,5), colorwhite,linethick2;{ Draw a moving average of 5th closing price, set the line to be thick white}
Ma2:ma (close,10), colorff00ff,linethick2;{ Draw a moving average of 10th closing price, set the line to be thick pink}
Ma3:ma (close,20), color00ff00,linethick2;{ Draw a moving average of 20th closing price, set the line to be coarse green}
A1:=cross (MA1,MA2); { 5th EMA on the 10th average, Golden Fork}
A2:=cross (MA2,MA1); { 10th EMA under wear 5th EMA, dead Fork}
DrawIcon (a1,low,1); { When the A1 condition is met, the red face is displayed at the lowest price position, indicating that it can be used as a buy point}
DrawIcon (a2,high,2); { When the A2 condition is met, the green face is displayed at the highest price position, indicating that it can be used as a sell point}


2, Function: DRAWLINE
Usage: DRAWLINE (cond1,price1,cond2,price2,expand), when the COND1 condition is met, draw a straight start in the PRICE1 position, when the COND2 condition is met, Draw the line end at the PRICE2 position, expand for the extended type.
Description: Draws a straight segment on the graph.
Example: DRAWLINE (HIGH>=HHV (high,20), HIGH,LOW<=LLV (low,20), low,1), which represents a straight line between a 20-day high and a 20-day low, and extends to the right.
DrawLine is the only drawing function that uses two cond in one sentence. Because it requires two points to determine the line. The
COND1 corresponds to the specified candlestick position (horizontal axis), and the PRICE1 corresponds to the specified price level (ordinate), so that the position of a point on the plane is determined. The
DrawLine is drawn from the 1th to the 2nd, which is the sequential relationship between the starting point and the end point: The time 1th appears before 2nd. Otherwise the line is not drawn.
EXPAND, expansion, development, here is the meaning of extension it. Take 0, do not lengthen, take 1, lengthen. In fact, a number greater than or equal to 1 will be extended, less than 1 will not be extended.
Indicator Example:
{seasonal EMA main chart}
Ema1:ema (close,20), colorff00ff;{ Draw a moving average of 20th close, set the line to pink}
Ema2:ema (close,40), color00ff00;{ Draw a 40-day closing average, set the line to green}
Ema3:ema (close,60), colorwhite,circledot;{ Draw a 60-day closing average, set the line to white O-line}
DRAWLINE (HIGH>=HHV (high,20), HIGH,HIGH>=HHV (high,20), high,1), colorwhite;{ Represents a straight line between a 20-day high and a 20-day low and extends to the right. }
DRAWLINE (HIGH>=HHV (high,20), HIGH,LOW<=LLV (low,20), low,1), Coloryellow; {Represents a straight line between a 20-day high and a 20-day low and extends to the right. }


3, Function: DRAWTEXT Description: Display text on the graph.
Usage: DRAWTEXT (cond,price,text), when the COND condition is satisfied, write text in the price position, can display multiple lines of text.
Example: DRAWTEXT (Close/open>1.08,low, ' rally Up '), which shows the word ' rally ' in the lowest price position when the increase is greater than 8% on that day. displaying text or characters directly in certain conditions is more intuitive than displaying icons. Note that the displayed text is enclosed in single quotation marks in the English state.
Examples of indicators:
{Long combined with main diagram}
Sma1:sma (close,5,1), color00ff00; {Draw a moving average of 5th closing price, set the line to be green}
Sma2:sma (close,10,1), Coloryellow; {Draw a moving average of 10th close, set the line to yellow}
Sma3:sma (close,60,1), Colorblue,linethick2; {Draw a 60-day closing average and set the line as a blue thick line}
DRAWTEXT (Close/open>1.08,low, ' rose up '), colorwhite; {Indicates that the ' rally ' is displayed at the lowest price position when the increase is greater than 8%. }


4, Function: POLYLINE description: Draw the broken segment on the graph.
Usage: POLYLINE (cond,price), when the COND condition is met, draw a polyline connection at the price position as the vertex.
Example: POLYLINE (HIGH>=HHV (high,20), high), which represents a polyline drawn between a 20-day high point.
Examples of indicators:
{Long combined with main diagram}
Sma1:sma (close,5,1), color00ff00; {Draw a moving average of 5th closing price, set the line to be green}
Sma2:sma (close,10,1), Coloryellow; {Draw a moving average of 10th close, set the line to yellow}
Sma3:sma (close,60,1), Colorblue,linethick2; {Draw a 60-day closing average and set the line as a blue thick line}
POLYLINE (HIGH>=HHV (high,20), high), colorwhite; {Represents a polyline (white) between a 20-day high point. }


5, Function: Stickline description: Draw the bar on the graph.
Usage: stickline (cond,price1,price2,width,empty), when COND conditions are met, draw a histogram between PRICE1 and PRICE2 positions, width can be 0---100 (10 is the standard spacing), Empth does not draw hollow columns for 0.
Example: Stickline (close>open,close,open,0.8,1); a hollow cylinder part that represents a line of a candlestick.
Key points to use:
⑴price1 and PRICE2 do not have a sequential relationship, that is, what does not affect the execution of the statement after the previous.
⑵width width, supports decimals. With 1 and 0.1, there will be a big difference. Take 4 o'clock and the candlestick width of the main graph is similar.
The following sub-graph formula, the drawing of the candlestick, and the main graph shows the same candlestick.
Examples of indicators:
{Secondary Graph Candlestick}
Stickline (C>o OR (C=o and C>ref (c,1)), o,c,4,1), colorred; {Draw a red K entity}
Stickline ((C>o and C<>h) or (C=o and C>ref (c,1)), c,h,0.1,0), colorred; {Draw the Red K Upper Shadow Line}
Stickline ((C>o and L<>o) or (C=o and C>ref (c,1)), l,o,0.1,0), colorred; {Draw Red K lower Shadow}
Stickline (Cstickline (Cma5:ma (c,5), colorwhite;
Ma10:ma (c,10), colorff00ff;

Drawing function together with the example is finished, I believe you must have something to gain, extrapolate himself to make up an indicator. Do not be afraid of failure, failure is the mother of success, try to put, you will certainly have a harvest.

The expression of large intelligent condition and its application

1, conditional expression: In the design formula, you need to use a lot of conditional expressions, according to the results of conditional expressions, to determine what to do next, what should not do. The basic conditional expression consists of a comparison operator such as >, >=, <, <>, <=, =, and, or, and a logical operator, where "and" represents and, and, "or" represents or, or. The value of the conditional expression is only 2, 1, and 0, the condition is set to return 1, the condition is not set to return 0, the following example illustrates:
Example 1:close>open{indicates that the closing price is greater than the open price, and if it returns 1, the value of this conditional expression is 0};
Example 2:close>open and Close>ma (close,5) {indicates that the closing price is greater than the open price and close is greater than the 5th average, and is "and," meaning that two conditions are met to make a judgment};
Example 3:close<ref (close,1) <br= "" Or= "" close<= "ref (close,2) {This close is less than the close of yesterday or the current close is less than or equal to the previous 2 days closing price," or "means or, or. It means that two conditions can be judged if one condition is met}; " > Description: In the above example, the contents of a pair of curly braces "{", "}" contained in the half-width are comment statements and will not be run. A good formula design, need to spend a lot of effort, time is likely to forget how it was designed, in addition to others can understand the formula, appropriate to add comments is a good habit.
2, if condition function: When designing a formula, the conditional function if is very important, often need to use, the comment is as follows:
If condition function, the value is different according to the condition.
To use: if (x,a,b) if X is not 0 then return A, otherwise return B
For example: if (Close>open,high,low) indicates that the period of the sun is the highest value returned, otherwise the lowest value is returned.
3, cross crossover function, this is also a common function. Usage: Cross (A, b), A: variable or constant, determines the first line of intersection. B: Variable or constant, judging the intersection of the second line. For example: Cross (MA (close,5), MA (close,10)), 5th EMA and 10th EMA Gold Fork, crosses (close,12), the price from the next upward breakthrough of 12 yuan.
Having understood the meaning of the conditional expression and the if conditional function, cross crossover function, let's design two formulas that have some practical value:
First formula:
{135 Tactics}
Short Stock: =ma (c,13); {13th closing average, ": =" does not show the EMA on the graph}
Stock Road: =ma (C,34); {34 days closing average, ": =" does not show the EMA on the graph}
Long: =ma (c,55); {55 The moving average of the closing price, ": =" does not show the EMA on the graph}
Short delivery Length: =cross (short stock path, length of the stock road); {Stock path short upward through the length of the stock, Gold Fork}
Medium: =cross (in the Stock road, the length of the stock road); {The stock path goes up through the long, Golden Fork}
Coarse selection: Short or medium length, coloryellow; {Short or medium-length two conditions have a set to show the Yellow pulse signal}
Short arrangement: = Short of Stock Road < Stock Road, and Stock Road, long < road length and Stock Road Central < stock road length; {Three conditions are set at the same time}
Flat upstream: = Short >=ref (short, 1) of the stock path; {greater than or equal to yesterday's 13th closing average}
Cheating:o< Short and c> stock Road short and flat upstream and short arrangement, colorred; {Four conditions at the same time display red pulse signal}
Bullish arrangement: = short > Stock Road Short > Stock Road Long and stock Road Central > Stock Road length; {Three conditions are set at the same time}
Springtime:o< Short and c> stock road short and long arrangement, color00ff00; {Three conditions are also set to show the Green pulse signal}
Basis: = Long >ref (length of the stock Road, 1) and Stock Road short > Stock Road Long and stock Road medium > Stock Road length; {Three conditions are set at the same time}
Brace: Basic and Cross (short, in-stock path), Colorwhite; {Two conditions at the same time display a white pulse signal}
Three-line Qi push:o< Short and o< Stock Road and o< Stock Road long and c> Stock Road short and c> Stock Road in and c> stock Road length, COLORFFCC66; {Six conditions at the same time display light blue pulse signal}
A second formula:
{Start soon}
Trend: 3*sma ((CLOSE-LLV (low,27))/(HHV (high,27)-llv (low,27)) *100,5,1) -2*sma (SMA ((CLOSE-LLV (low,27))/(HHV (high,27)- LLV (low,27)) *100,5,1), 3,1), Coloryellow;
Launch imminent: IF (Cross (trend, 3), 100,0), colorff00ff;
Secret buy: IF (Trend <=3,25,0), color00ff00;
Institutions Open Positions: IF (Trend <5,45,0), colorwhite;
Formula Explanation:
Trend: Avg Moving Average ((Close price-lowest value (lowest price, 27))/(highest value (high, 27)-Lowest (lowest price, 27)) *100,5,1) -2* moving Average ((Close price-lowest value (lowest price, 27))/(highest value (high price, 27)-Lowest value ( Lowest price, *100,5,1), 3,1), Coloryellow; {Draw a yellow trendline, the number 27 indicates the period, which is 27 days, the numbers 5 and 3 also represent periods of 5 days and 3 days}
Stock price start imminent: Conditional function (crossover function (trend, 3), 100,0), colorff00ff; {The trend is wearing coordinates 3, the pink pulse signal is displayed at coordinates 0 to 100}
Hunting secret buy Point: Conditional function (trend <=3,25,0), color00ff00; {The trend is less than or equal to coordinate 3 and the green pulse signal is displayed at coordinates 0 to 25}
Establishment of additional warehouses: Conditional functions (trend <5,45,0), colorwhite; {The trend is less than coordinate 5 and the white pulse signal is displayed at coordinates 0 to 45}
The above 2 indicators suggest you control the indicator statements and graphs repeatedly read a few times, you can also modify the length of the pulse signal, etc., more important is to understand the indicator combination, nested meaning, only read the indicators, you can put their ideas, ideas into indicators.
[NextPage]


Great wisdom--the refinement of linear function

One, linear function
Linear functions are used in conjunction with other indicator functions in order to be effective, as they all describe other indicator functions. The correct use of linear function can make the main sub-graph indicator display colorful, colourful.
1, Function: STICK description: Draw Bar-like line, STICK English is stick, stick meaning.
As the sub-figure formula: C>ref (c,1) and C>ref (c,2), STICK;


2, Function: Colorstick description: to 0 axis as the center of the color bar line, 0 axis for the color of the yin line, 0 axis for the color of the Yang line, so that the 0 axis, such as Chu-Han Junction, clear.
As the sub-chart formula: C-ref (c,1), Colorstick;


3. Function: Linestick Description: Draw bar line and indicator line at the same time. Line is a thread, stick is a stick, Linestick is naturally shown together with a bar. As the sub-graph formula:
A:=c-ref (c,1);
A,linestick;


If you want to display the indicator line and bar line, and want to display the two color bars in the center of the 0 axis, you can use separate two sentences to achieve the purpose, such as the sub-graph formula:
A:=c-ref (c,1);
A,linestick;
A,colorstick;


4, Function: Volstick Description: Draw the volume column line. This is specifically designed for the display volume. As the sub-graph formula:
Vol,volstick;


5, Function: Crossdot description: Draw a fork or X-shaped line. Cross is the intersection, DOT is dot. As the sub-graph formula:
Ma1:ma (c,30), Crossdot;


6, Function: Circledot description: Draw small circle lines, such as the sub-chart formula:
Ma1:ma (c,30), Circledot;

7, Function: Linethick Description: Change the thickness of the indicator line. Take 1, 2, 3, 4, 5, 6, 7 placed behind the Linethick such as: LINETHICK2, the larger the number, the thicker the line, the maximum desirable 7. As the sub-graph formula:
Example 1:ma1:ma (close,30), Colorff00ff,linethick2;
Example 2:a:=c-ref (c,1);
A,colorstick,linethick4;

8, Function: Pointdot description: Draw dot line, point is dot, add the meaning. This dot line looks a bit too small to be used with the bold line function. As the sub-graph formula:
Ma1:ma (c,30), Color00ff00,pointdot,linethick2;


Let's compile an indicator to see which linear functions are used.
{top-bottom indicator}
Stock trend: 3*sma ((CLOSE-LLV (low,27))/(HHV (high,27)-llv (low,27)) *100,5,1) -2*sma (SMA ((CLOSE-LLV (low,27))/(HHV (high,27) -LLV (low,27)) *100,5,1), 3,1), Colorff00ff,linethick2;
Bottom guard: 10,colorffcccc,pointdot;
Buy Alert: IF (stock price trend <=10,40,0), Stick,linethick3,coloryellow;
Buy signal: IF (Cross (stock price trend, bottom alert), 80,0), Stick,linethick3,colorblue;
Strong and weak demarcation: 50,colorwhite,pointdot,linethick2;
Top alert: 90,colorffcc66,pointdot;
Sell alert: IF (stock price trend >=85,40,0), stick,linethick3,colorred;
Sell signal: IF (Cross (stock price trend, top alert), 80,0), stick,linethick3,color00ff00;

Indicator Analysis:
{top-bottom indicator}
Price trend: Average (Close price-lowest value (lowest price, 27))/(highest value (high price, 27)-Lowest value (lowest price, 27)) *100,5,1) -2* moving Average ((Close price-lowest value (lowest price, 27))/(highest value (high price, 27)- Minimum value (min.)), *100,5,1), 3,1), Colorff00ff,linethick2;
Bottom alert: 10,COLORFFCCCC, dot-shaped line;
Buy Alert: Conditional function (stock price trend <=10,40,0), bar-like line, Linethick3,coloryellow; {Yellow Coarse Bar}
Buy Signal: Conditional function (cross function (stock price trend, bottom guard), 80,0), bar-like line, Linethick3,colorblue; {Blue Coarse Bar}
Strong and weak demarcation: 50,colorwhite, Dot Line, LINETHICK2; {Thick dot line}
Top alert: 90,colorffcc66, dot-shaped line;
Sell ALERT: Conditional function (stock price trend >=85,40,0), bar-like line, linethick3,colorred; {Red Coarse Bar}
Sell signal: Conditional function (cross function (stock price trend, top alert), 80,0), bar-like line, linethick3,color00ff00; {Green Coarse Bar}
Understand the above linear function, learn to put their own indicators to beautify it, each of the above examples you can try in the big wisdom, personally experience. I wish you all success.

Introduction to the large smart moving average function.

Structure of the indicator:
1, a complete indicator to have its own name, such as the million copy bottom, steady pursuit of inflation and so on. One is easy to use, and the other is that no name can be tested in the indicator editor.
2, an indicator statement to have a statement name. such as: Var1:ma (close,5), Var1 is the name of the statement, multiple statements can be arranged in order such as VAR1, VAR2, Var3 and so on.
3, in the formula used in the punctuation marks are in the English state of the symbol.
4, in the formulation formula, has to display the sentence and does not display the sentence, wants to display uses ":" does not display with ": =",
There can be up to 16 sentences in a source code, and a semicolon ";" is added to the end of each sentence. such as Var1:ma (close,5); the 5th EMA is shown on the graph, Var1:=ma (close,5); The moving average is not displayed on the graph, indicating that other statements are referencing it.
5. Open, close, high (higher), lowest (low), Volume (vol) in the formula can be replaced by the first letter of the function, such as VAR1:MA (c,5);. Therefore, do not use these letters as a statement name when compiling the formula.
6, Design calculation parameters: We sometimes need to adjust the formula in the constants to see the expression of the formula, you can directly enter the formula to modify, more convenient method is to use parameters to refer to the formula in the constant, need to adjust the formula without the need to enter the formula only to adjust the parameters can be. For example, to modify the second parameter in ref (close,1) 1, you can set it to a calculation parameter N, the formula is written in ref (Close,n), and then adjust N. The calculation parameters include the parameter name, minimum value, maximum value, and default value of four parts. The parameter name is used to identify the parameter, in this case we position the parameter name N and calculate the formula with the default value, while the minimum and maximum values are the adjustment ranges of the parameters.
7, the technical indicators are divided into the main diagram and the sub-diagram, the default state of the indicator after the completion of the test through the confirmation is a sub-graph; if it is the main chart indicator, the test will select the main graph overlay in the indicator editor before confirming.
Let's get down to the chase.
There are roughly four types of moving average functions:
1, MA simple moving average, meaning to find a simple moving average. Usage: MA (x,n), find the N-day moving average of X. For example: MA (close,10), the average price of 10th.
Notation of the moving average: calculates the arithmetic mean of the closing price of N days, the formula is: MA (x,n) represents the N-day average of X.
For example:
Ma1:ma (close,5), Coloryellow;
Expressed as: statement painting a moving average of 5th closing price set the line to yellow
2, the EMA exponential smooth moving average meaning is to seek exponential smooth moving average. Usage: EMA (x,n), the N-day index of X is smoothed moving average. For example: EMA (close,30), which represents the 30th exponential smoothed average.
Figure of the moving average: calculates the arithmetic mean of the closing price of N days, the formula is: EMA (x,n) represents the N-day average of X.
For example:
Ema1:ema (close,5), colorff00ff;
Expressed as: statement painting a moving average of the closing price of a 5th the line is pink
3, the DMA dynamic moving average meaning is to seek the dynamic moving average. Usage: DMA (x,a), to find the dynamic moving average of X, A must be less than 1. For example, DMA (Close,vol/capital), which represents the average price for the smoothing factor with a turnover rate. (Capital is the size function of the circulation disk)
Figure of the moving average: calculates the arithmetic mean of a closing price, the formula is: DMA (x,a) represents the N-day average of X.
For example:
DMA1:DMA (close,vol/capital), colorff00ff;
Expressed as: statement painting a moving average with a turnover rate as a smoothing factor close price set the line to pink
4, SMA moving average seeking moving average. Usage: SMA (x,n,m), the N-day moving average of X, M is the weighting. n must be greater than M. For example: SMA (close,30,1), which represents the 30th moving average price.
Figure of the moving average: calculates the arithmetic mean of the closing price of N days, the formula is: EMA (x,n) represents the N-day average of X.
For example:
Sma1:sma (close,30,1), colorff00ff;
Expressed as: statement painting a moving average of the closing price of a 30th the line is pink
Understanding the above function usage, we begin to compile the first indicator:
Give the indicator a name, called the "average monthly line map" Bar!
Ma1:ma (close,5), colorwhite; {Draw a moving average of 5th close, set the line to white}
Ma2:ma (close,10), colorff00ff; {Draw a moving average of 10th close, set the line to pink}
Ma3:ma (close,20), color00ff00; {Draw a moving average of 20th closing price, set the line to be green}
...... Multiple lines can be drawn according to individual needs.
If you want to set a parameter, the default value of the minimum value by parameter name adds the following value in the indicator editor:
N1 1 100 5
N2 1 100 10
N3 1 100 20
The indicators of 5, 10, and 20 were changed to N1, N2, N3 can be.
Second indicator: The name of the "seasonal Moving Average master chart"
Ema1:ema (close,20), colorff00ff; {Draw a moving average of 20th close, set the line to pink}
Ema2:ema (close,40), color00ff00; {Draw a 40-day closing average, set the line to be green}
Ema3:ema (close,60), colorwhite; {Draw a 60-day closing average, set the line to white}
....... Multiple lines can be drawn according to individual needs.
Third indicator: Naming "long-term combined with the main map"
Sma1:sma (close,5,1), color00ff00; {Draw a moving average of 5th closing price, set the line to be green}
Sma2:sma (close,10,1), Coloryellow; {Draw a moving average of 10th close, set the line to yellow}
Sma3:sma (close,60,1), Colorblue; {Draw a 60-day closing average, set the line to blue}
DMA Dynamic Moving average is seldom used, here is not an example, interested friends to play it.
Color code is available to select settings:
Various colors indicate:
Red colorred, Gray Colorgray, green color00ff00, Yellow coloryellow, Blue colorblue, white colorwhite.
In addition, the colors are:
Pink colorf00ff0, Grass green color00ff00, light blue colorf0f000, purple colorff0099, golden color008364, purple color000999, full color color0055ff, Dark Yellow COLOR00CCCC, purple Roland colore66878, Turquoise colorff937f Deep Green color399c7f
In fact, as long as the color after adding 0-9, a-f in any of the 6 alphanumeric characters, if you want other colors, you can adjust their own.

A tutorial on important functions of great wisdom

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.