设为首页收藏本站从MACD相关函数、指标、信号代码看PL与EL的差异

FX628外汇论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 226|回复: 0

[MultiCharts分析软件] 从MACD相关函数、指标、信号代码看PL与EL的差异

[复制链接]
  • TA的每日心情
    奋斗
    2017-9-3 16:28
  • 签到天数: 4 天

    [LV.2]偶尔看看I

    发表于 2017-8-20 18:47:26 | 显示全部楼层 |阅读模式

    马上注册,结交更多好友,享用更多功能,让你轻松玩转外汇。

    您需要 登录 才可以下载或查看,没有帐号?立即注册

    x
    MCAD(BuiltIn-Function)(函数):
    . i2 i" N3 t  K; `3 `. Oinputs: * b; [+ t9 C1 f  Y# }  }+ J
            PriceValue( numericseries ),   }$ W7 @9 X) n9 G
            FastLen( numericsimple ),                                             
    7 M% Q* S/ v& D1 o7 q- C        SlowLen( numericsimple ) ;                                             8 i* s4 L$ i: v) D. F% R5 O
    * h; }; |3 E' Q- {. T5 A
    MACD = XAverage( PriceValue, FastLen ) - XAverage( PriceValue, SlowLen ) ;% d4 e1 o- j, {) F3 J
    ' m) k0 I7 e/ M
    EL 之 MACD函数:
    $ t; R7 H' j8 s6 k& r{ Search Tag: WA-MACD }0 j, S) p& E: v1 o0 p' o7 ?" v
    inputs:
    / x6 U, J# w  I' D. w- X        Price( numericseries ),
    / O6 S8 ^/ g7 }. F        FastLength( numericsimple ), { this input assumed to be a constant >= 1 }
    + |8 d5 U. F1 n$ ^& u        SlowLength( numericsimple ) ; { this input assumed to be a constant >= 1 }! F. O6 {- C& Z3 k; G

    3 x4 |6 y7 `, A$ r% P1 cMACD = XAverage( Price, FastLength ) - XAverage( Price, SlowLength ) ;
    # K9 ~  L! R3 V! s* I) ^& E' x2 g# H  B6 v$ u' R3 ]9 D

    0 o* y; v* `; @+ f{ ** Copyright © TradeStation Technologies, Inc.  All Rights Reserved **
    $ h% X$ n  l7 V& R0 I3 G9 P# ?. D  ** TradeStation reserves the right to modify or overwrite this analysis technique
    $ O5 b, z: U" N9 R     with each release. ** }7 {: N) C" {7 V( i( r

    1 }2 y1 @! e# k% [3 O# o7 ?% U6 g% y% \  o  v$ Y

    $ C6 ?5 I9 d( L+ RMACD(指标):
    # O% h2 [1 m0 t# Kinputs: FastLength( 12 ), SlowLength( 26 ), MACDLength( 9 ) ;
    6 i. M8 w! [0 j& S% V# m9 Zvariables: var0( 0 ), var1( 0 ), var2( 0 ) ;
    - S# R) a' t- G5 L8 \
    4 H0 J- i. \7 }% V5 E( p1 Ovar0 = MACD( Close, FastLength, SlowLength ) ;
    9 p5 i: N6 @  [+ yvar1 = XAverage( var0, MACDLength ) ;
    4 M7 u% O, X" Y" Uvar2 = var0 - var1 ;3 n% C" j# M& ^: h
    3 `" r0 s1 w# f* b9 G
    Plot1( var0, "MACD" ) ;# F! \5 w$ }& y7 k' ~$ u
    Plot2( var1, "MACDAvg" ) ;$ N1 s. }2 M8 i5 N, G6 l1 q# l5 i" l
    Plot3( var2, "MACDDiff" ) ;
    6 D0 d8 Y, {5 }7 PPlot4( 0, "ZeroLine" ) ;
    / d# d2 u6 t% Z$ M4 ]  o0 p& {! d7 o* x( R5 U
    condition1 = var2 crosses over 0 ;     ( T5 o8 W0 P3 P) t, m; H
    if condition1 then7 W# C' e" p, I9 v, O, z+ e
            Alert( "Bullish alert" )0 |; V* m$ k: F* w5 ?6 Z
    else ) o3 x9 s+ l' z; Y  |
    begin ) ^* }  j4 L& `
    condition1 = var2 crosses under 0 ;: L3 K4 |( P  L* j6 t( r
    if condition1 then
    ! ^5 L+ J3 `& o+ d4 a5 Z        Alert( "Bearish alert" ) ;! ~! q& j" Q' {2 L( D
    end;, Q& M  [7 X) R3 F, p
    $ W) _. }- _! P0 h+ R( n. }
    {通达信指标:
    1 f4 f/ T5 |* Z) O. w{SHORT:12,LONG:26,MID:9}
    0 f" }6 d$ e! ?DIF:EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
    ; h$ B0 v( ~+ s) U5 xDEA:EMA(DIF,MID);
    $ M" }' o0 \$ o. OMACD:(DIF-DEA)*2,COLORSTICK;}: e$ @6 F8 S3 z8 C: e
    : ^8 V* ?  U/ K) e: u7 V- K
    EL 之 MACD 指标
    : D( f7 t! ^- t  F{ Search Tag: WA-MACD }
    & B7 v3 B6 L3 e' z) _, j
      J% z! o# N6 v$ v1 ~1 W{ Moving average convergence-divergence indicator }1 N& `! h! M( s4 {" P
    , h8 Z: U7 s' Q( y, z  i5 `8 t4 ?, G
    inputs:
    & q" X7 d5 `5 J        double FastLength( 12 ) [DisplayName = "FastLength", ToolTip = 0 Z. U  C0 p/ L5 O
             "Enter number of bars to use in calculation of shorter length moving average."],
    8 R, p/ S! K) E- I9 r        double SlowLength( 26 ) [DisplayName = "SlowLength", ToolTip = / x( f0 A8 r8 b5 T( C0 Q
             "Enter number of bars to use in calculation of longer length moving average."],+ C) ^9 h3 o( p) R  {
            double MACDLength( 9 ) [DisplayName = "MACDLength", ToolTip = 1 u7 _# W1 P# e. H4 H, U: j
             "Moving Average Convergence Divergence Length.  Enter the number of bars to use in smoothing the MACD value."],
    5 E  [1 B3 U2 b0 G        int AlertIfCrossUp( 1 ) [DisplayName = "AlertIfCrossUp", ToolTip =
    , K4 b+ O, K3 X; M7 C; ?6 E         "Enter 1 if it is desired for an alert to be triggered when the MACD histogram's value crosses from below 0 to above 0;  enter 0 if it is not desired that an alert be triggered in this case."],
    2 c0 `( w; s  \& T$ m        int AlertIfCrossDown( 1 ) [DisplayName = "AlertIfCrossDown", ToolTip =
    ! _( ?( U! o* V  @% {. t& }         "Enter 1 if it is desired for an alert to be triggered when the MACD histogram's value crosses from above 0 to below 0;  enter 0 if it is not desired that an alert be triggered in this case."],
    * p: _! O. P' T) D$ v8 T8 K+ e        int MACDDiff_Up_Color( UpColorDefault ) [DisplayName = "MACDDiff_Up_Color", ToolTip = 0 b4 M+ j6 y" g6 _  z
             "Moving Average Convergence Divergence Difference Up Color.  Enter the color to be used for positive values of the MACD Difference (MACD Histogram)."],0 x7 Z- V5 H: M+ I, l" [* e
            int MACDDiff_Down_Color( DownColorDefault ) [DisplayName = "MACDDiff_Down_Color", ToolTip =
    $ Z  p1 f* O9 F3 q5 ^         "Moving Average Convergence Divergence Difference Down Color.  Enter the color to be used for negative values of the MACD Difference (MACD Histogram)."],; D: h/ ^% |' N; T9 t6 k9 D& b2 R
            int BackgroundColorAlertCell( DarkGray ) [DisplayName = "BackgroundColorAlertCell", ToolTip = 1 ~  S& g: H/ h1 m
             "Enter the color to use for RadarScreen cell background when alert occurs."];6 G! R, y  R3 \3 D7 Y
                    , ?0 B5 o1 p  L  P) h7 x7 r6 O
    variables:
    ) l5 z( Q1 K% {+ O# r2 ~2 r        intrabarpersist bool InAChart( false ),- ^& _3 ?8 N( \3 S
            double MyMACD( 0 ),: y% A$ o! }" k
            double MACDAvg( 0 ),, {3 ^$ i7 y3 c2 k! {; e
            double MACDDiff( 0 ),, d* I1 @7 U" C0 I- L( J* c
            double HistogramColor( 0 ),
    7 v' e- c- J! @; r6 }: x3 W        int CrossBarsAgo( 0 );
    8 f* J; g0 G+ ^               
    " w7 U6 ?3 c3 q! S$ y9 e: k7 donce
    * h$ b0 Q* ~+ g# v. gbegin
    " u, z* Q8 ?2 E+ T; n, Y7 h        InAChart = GetAppInfo( aiApplicationType ) = cChart;
    ( p# z, ?9 Z% I+ ?end;
    6 S7 b. |+ s4 x; X2 T7 I4 k# F                , e& ]5 B7 _# ~. V5 J/ t5 `" J
    MyMACD = MACD( Close, FastLength, SlowLength );
    6 ^8 i- H% D0 \/ q' j. w( P6 ZMACDAvg = XAverage( MyMACD, MACDLength );
    * r$ v1 O" K4 I- A# `MACDDiff = MyMACD - MACDAvg;$ T# Q$ Y4 T- `/ O- R( N' r
    HistogramColor = IFF( MACDDiff > 0, MACDDiff_Up_Color, MACDDiff_Down_Color );; h* f5 C9 W( c) ]9 f1 w3 D. k' R
    9 w6 T3 K9 m" R$ [
    if ( MACDDiff > 0 and MACDDiff[1] <= 0 ) or ( MACDDiff < 0 and MACDDiff[1] >= 0 )
    9 D) u$ s3 f) w% D8 w- k then9 \2 A3 o5 J4 D! y8 r6 i6 q- L  C
            CrossBarsAgo = 0  q& c! r2 y- ^! |
    else3 L& s$ P0 f. \' S
            CrossBarsAgo += 1;" u) m/ p2 x% |( c

    6 G9 c/ w$ Y# N, J4 S6 k; HPlot1( MyMACD, !( "MACD" ) );
    ; n$ {$ {' Z4 XPlot2( MACDAvg, !( "MACDAvg" ) );
      ?' b0 D& h, x1 ]; o) oPlot3( MACDDiff, !( "MACDDiff" ), HistogramColor );
    ( N) E( V, ~; D& [Plot4( 0, !( "ZeroLine" ) );
    $ e& ~- H7 `2 |. A5 ^$ ~# o
    * u% O  d9 [# F( p! z1 O: P' l9 mif InAChart = false then
    $ e1 H# U* g! C! f3 x) q$ x) w        Plot5( CrossBarsAgo, !( "CrossBarsAgo" ), HistogramColor );* f- n" j/ ]9 G, H  I/ L) v
    5 z  ?  i1 [) x
    { alert criteria }
    3 g( x/ g+ o- l' l/ ?5 u2 Eif AlertEnabled then" _1 `+ t, q1 \
    begin3 i; i3 o. m* o: m: c! n, L
            if MACDDiff crosses over 0 then
    " ^9 N0 e6 g7 l( n0 a# w8 `: W& C/ F        begin
    3 O& h7 n6 q, ?3 f1 i6 W1 {                SetPlotBGColor( 5, BackgroundColorAlertCell );4 E% ^- ?; o7 E% w8 J
                    if AlertIfCrossUp = 1 then! Z- O$ K, j) |$ _9 V# m7 }! O
                            Alert( !( "MACD diff. crossed over 0." ) );
    % F# j0 C% Z! s$ r! y5 l        end
    % P' k0 P; E/ O5 d; a. Y( T        else if MACDDiff crosses under 0 then6 ]- }3 P3 [; z/ {; P( W2 M
            begin
    . \. w7 u2 W: ~, z( w+ T/ M/ u                SetPlotBGColor( 5, BackgroundColorAlertCell );+ p* b- T! g$ I; k+ b7 _* r: P; A: U
                    if AlertIfCrossDown = 1 then) K/ o) R. Z  J5 h1 c
                            Alert( !( "MACD diff. crossed under 0." ) ); 2 M" `9 B7 P4 c* W) {
            end;2 ^. h- ^$ T. u, V
    end;
    6 _  }% R( n6 a  T0 o- k3 d               
    8 W. P/ [6 ]" C; |( h
    ( h- ]! B- d* c  v+ K{ ** Copyright © TradeStation Technologies, Inc.  All Rights Reserved **
    - B+ B$ i0 U- R% u# \% e6 a  ** TradeStation reserves the right to modify or overwrite this analysis technique
    - ^' x6 D" T3 n% p5 ~4 C8 j% a     with each release. ** }% b8 d" g- i$ C0 ~( Y, f
    ( E' @/ f/ [' ^

    7 }# `# q2 B* `* U% R! P% SMACD Gradiet(指标):
    5 q- H8 b+ f: y' f$ Sinputs:
    % Y5 F, d1 y+ F& D. i' `  d        FastLength( 12 ),
    $ I( f+ X% A; z+ v3 i0 b+ N0 C        SlowLength( 26 ),& ^9 W4 |  f+ s. y- b" X
            MACDLength( 9 ),
    ! t5 b1 f. u, Y) H        ColorNormLength( 14 ),
    " m0 F8 N5 r  d5 _+ f0 e        UpColor( Yellow ),! N3 ~) O4 r. y/ j- d" c! S: P* l
            DnColor( Magenta ) ;
    : `8 I9 `! _; Z8 \7 T) a- B5 A8 Y  W0 N% ]0 r  D
    variables: 2 W& p. L3 F, K% ?: y6 g
            var0( 0 ),
    - x6 L( z3 q, {6 _) `4 G- c+ b        var1( 0 ),0 H! f- f7 ^4 ]. M6 q7 ~
            var2( 0 ),' S* K( ]/ m# ^% V
            var3( 0 ) ;
    * @8 M% X) w/ n; n( o" N7 O& _
    : L- Q* T' W% d$ |4 X; _3 avar0 = MACD( Close, FastLength, SlowLength ) ;
    3 b! V( |8 _5 Xvar1 = XAverage( var0, MACDLength ) ;& d, D4 @4 F7 {! h3 k
    var2 = var0 - var1 ;" o! a  w' N% y! Y
    var3 = NormGradientColor( var2, true, ColorNormLength, UpColor, DnColor ) ;
    ( D, F  T- P& R' o" X# R: T* M; A1 J  A; y* g0 o
    PlotPB( High, Low, Open, Close, "MACDGrad", var3 ) ;5 L% y: k3 l! T% s) c
    : ~2 T0 F8 w& ]5 V# B9 d, g, O
    MACD K线(MACD Gradiet)(指标):+ m) V7 b( V6 K5 z/ J; A
    inputs:
    3 U1 w# T+ C0 }/ m" y3 t1 _$ V% T9 y        FastLength( 12 ),2 L/ Z. V  V* `  l. h! s
            SlowLength( 26 ),
    1 p' T) l( u( Y% P        MACDLength( 9 ),
    ) V+ M, l3 ?: t* Y1 L( k        ColorNormLength( 14 ),
    2 O! O# j6 [# j8 [! B        UpColor( Yellow ),
    4 `6 a" D# h; t5 R- E0 i/ F* U. i        DnColor( Magenta ) ;
    , L! h- _. R. g- G9 y+ @' E5 y. ~5 M* y7 }0 e$ o' x
    variables: - R! v5 g2 B1 \) s6 T6 y) X
            var0( 0 ),
    : y( Q6 ]7 h: I# R3 L: Y7 \        var1( 0 ),
    ( l& R$ J2 f! Q3 z4 P        var2( 0 ),* v8 N$ _( E& |( \) s7 E
            var3( 0 ) ;
    ' k) u5 D, i6 Y. Y1 v0 @$ A* G9 L- i) \1 F8 [) C
    var0 = MACD( Close, FastLength, SlowLength ) ;
    . @5 ~# {# T6 ?; A" y! N* xvar1 = XAverage( var0, MACDLength ) ;
    : u  o5 B4 p  x4 V7 ?var2 = var0 - var1 ;
    1 e0 }) d, q" C; j% Mvar3 = NormGradientColor( var2, true, ColorNormLength, UpColor, DnColor ) ;) N& @: p: @, h) L2 h

    ' G( |# m1 C5 j5 j7 aPlotPB( High, Low, Open, Close, "MACDGrad", var3 ) ;
    5 ~4 m- g" s! [5 T+ x$ d( L2 p' B# I+ b# ~
      p' y: W8 }# q4 f% o
    指数平滑移动平均线(MACD)(指标):
    0 _7 Y6 f3 Y& V4 c, a! [/ M% Q
    $ g5 ]4 U1 i) `/ E% ^+ ainputs: FastLength( 12 ), SlowLength( 26 ), MACDLength( 9 ) ;% K9 Y6 `9 j2 S1 l. _
    variables: var0( 0 ), var1( 0 ), var2( 0 ) ;
    ; F0 G- \1 H% I8 n) ~& n7 K
    8 m9 G" {5 K7 J3 l( C/ ]' Ivar0 = MACD( Close, FastLength, SlowLength ) ;
    2 P8 r" ^$ }) k) I; k/ G& [var1 = XAverage( var0, MACDLength ) ;
    # n- x* n, \4 y, X4 G  W7 hvar2 = var0 - var1 ;
    & i! {. u; T4 V# l
    # S- ?# b5 a) R+ h: d) JPlot1( var0, "MACD" ) ;
    ( O3 [# x. S9 j. ?; Q6 l5 \. R/ oPlot2( var1, "MACDAvg" ) ;
    1 x5 L' Z; G$ O2 f( y! WPlot3( var2, "MACDDiff" ) ;5 M: X, E5 ~  t4 Z3 R) v
    Plot4( 0, "ZeroLine" ) ;
    6 u3 V9 e1 R7 r2 n* q& G& }
    8 e" s+ W- A( I) T2 ^( Ycondition1 = var2 crosses over 0 ;     % @" E$ C! L4 E2 |# w
    if condition1 then9 c7 e/ z% w. x: R+ t
            Alert( "Bullish alert" )2 m% K1 s3 x/ b% k* y4 ]
    else
    . k9 d1 s: |# B0 ibegin . o4 J5 q* [; u
    condition1 = var2 crosses under 0 ;
    / ]/ X# `9 ?$ U5 f3 V. N/ L! z2 Jif condition1 then
    1 N0 E6 Z, _+ ^* V5 N        Alert( "Bearish alert" ) ;
    2 c7 I+ L7 K/ {+ W" h2 Oend;
    ' r6 B- X5 t$ m( X8 H3 l# t6 o( q/ s8 p( G

    8 o9 x3 D! g- C6 Y) l: ZMACD LE(信号):+ V; j! O+ u7 C( W% M( C) k# y
    inputs:  FastLength( 12 ), SlowLength( 26 ), MACDLength( 9 ) ;* s% Y! l0 {. b  U4 n
    variables:  var0( 0 ), var1( 0 ), var2( 0 ) ;/ w+ T: s5 ?! w1 b9 E% ~

    - R! Z5 d2 U  \- Bvar0 = MACD( Close, FastLength, SlowLength ) ;+ z7 Q. O! C0 _& X/ P: \
    var1 = XAverage( var0, MACDLength ) ;/ v7 _' j6 i5 \1 W1 M  x' U( _
    var2 = var0 - var1 ;
    9 R8 ^  h& C. {2 p6 B: L" t! D) D# H: P# _7 c
    condition1 = CurrentBar > 2 and var2 crosses over 0 ;
    + V- R% r2 Y, I$ i( v. t4 Nif condition1 then                                   8 L" V4 `$ y" E% y& L  a! A9 |; C
            Buy ( "MacdLE" ) next bar at market ;7 m8 t4 Y0 @, F) t

    ' m- k2 \' ^) {8 _# C3 i: _7 d1 u" K: r& P! x: _( j9 ?5 f3 j
    EL 之 MACD LE 策略:$ H' ?: d3 t: C7 q9 @/ D
    { Search Tag: WA-MACD LE }
    9 d  o% B. v* P; q: ]  b
    * k. p" v6 q8 @' E1 I8 ?! ^6 jinputs:  & d+ d" J  D3 f1 _- ^
            FastLength( 12 ) [DisplayName = "FastLength", ToolTip = % b/ j. i1 v* k& Z
             "Enter number of bars to use in calculation of shorter length moving average."],
    + k6 W/ G/ Z6 V        SlowLength( 26 ) [DisplayName = "SlowLength", ToolTip = 7 `  r' R5 o9 G9 J; [7 |
             "Enter number of bars to use in calculation of longer length moving average."],
    # A, H1 O+ g1 F        MACDLength( 9 ) [DisplayName = "MACDLength", ToolTip = 6 }6 p' i7 K6 y' u) I; N- s2 m
             "Moving Average Convergence Divergence Length.  Enter the number of bars to use in smoothing the MACD value."];
    0 I3 w5 h" y0 w- {       
    " L0 n; B8 j% b- m; }. d* K$ {variables:  ; k- }7 h) q0 n4 q! W/ |9 M
            MyMACD( 0 ), 1 p/ U+ b# i7 }: `# v# u
            MACDAvg( 0 ), ) k1 x1 q# j3 s' M
            MACDDiff( 0 );8 g) c& a7 j7 N( j  w( ^
    - C$ q" z  G/ a* A7 `- A" S0 I
    MyMACD = MACD( Close, FastLength, SlowLength );
    6 H! |7 g7 T( a. B. r' d; jMACDAvg = XAverage( MyMACD, MACDLength );
    6 q) g0 e% A% W! m" q1 I- B0 wMACDDiff = MyMACD - MACDAvg;' p4 h: Z9 R) Q! z4 ]% a; O' q
    9 b3 ?& ~, e- A2 F
    { CB > 2 check used to avoid spurious cross confirmation at CB = 2 (at CB = 1,
    - |; S7 n' f) ]5 K) K/ t) r" [- X  MyMACD and MACDAvg will be the same) }+ `" o9 |7 d9 U2 B! X5 b& D9 {
    if CurrentBar > 2 and MACDDiff crosses over 0 then 1 ~' P. A* Z, h8 R2 }9 }! O
            Buy ( !( "MacdLE" ) ) next bar at market;0 M) k2 K" n+ V! A; ^
    + {. U# x9 H! }' i# C5 S& ~
    + L" s8 k. k% _6 p; R7 E
    { ** Copyright © TradeStation Technologies, Inc.  All Rights Reserved **
    & _7 i; z; p! U: V, W  ** TradeStation reserves the right to modify or overwrite this strategy component
    2 a& z: V6 I" o     with each release. ** }
    0 [& D# o  ?: a' O5 F9 B7 y+ c
    $ E' ?, l% _- [$ f$ D* S7 d' e, N3 p+ B
    + P; N; ~9 r! N( y3 C  S  GMACD SE(信号):
    1 w1 Q( ^. I' V3 u# I8 Qinputs:  FastLength( 12 ), SlowLength( 26 ), MACDLength( 9 ) ;$ t0 q; s* g8 [' l: i
    variables:  var0( 0 ), var1( 0 ), var2( 0 ) ;- f3 B7 L4 o) T; u

    - n! A1 {4 D: ^- b: j! fvar0 = MACD( Close, FastLength, SlowLength ) ;2 _3 A) y% q% S
    var1 = XAverage( var0, MACDLength ) ;& Z; w6 Z# i$ N( [( Y0 U9 m( B8 a- `
    var2 = var0 - var1 ;
    ) h* b- G. R/ {% I
    $ @# C. ]5 r0 Q  m8 zcondition1 = CurrentBar > 2 and var2 crosses under 0 ;1 M$ o7 o# Z: O" ?/ @7 L+ i
    if condition1 then                                   
    2 I4 \; t; f$ ~$ b4 w% o) G" B        Sell Short ( "MacdSE" ) next bar at market ;
    . r8 _/ R3 u1 g$ u) B9 d# D( l
    & ^! I/ Q5 j$ u! O! }EL之 MACD SE 策略:, B) _. c& o9 B- L( [/ o; |; Y$ m
    { Search Tag: WA-MACD SE }9 y5 o) P4 }8 k/ v$ Q

    + x& J, |* P( a, e: H; s; N& ninputs:  
    + b$ a9 M* i. @1 e5 u( E        FastLength( 12 ) [DisplayName = "FastLength", ToolTip = 9 \) b- R& _0 }. t% _) y- d8 x
             "Enter number of bars to use in calculation of shorter length moving average."], . \8 j7 Z' F/ L3 g1 A
            SlowLength( 26 ) [DisplayName = "SlowLength", ToolTip = * r7 O* t* |* H2 K' Z* G* R7 x& V9 N
             "Enter number of bars to use in calculation of longer length moving average."], % @+ P: B4 _6 p8 P
            MACDLength( 9 ) [DisplayName = "MACDLength", ToolTip = 3 q% L, _( o1 [' |7 @7 p% v
             "Moving Average Convergence Divergence Length.  Enter the number of bars to use in smoothing the MACD value."];& U# }& B1 v3 c1 B% Z0 F; H
           
    6 r1 R. N2 D3 w* K$ O6 rvariables:  
    5 W: i4 d( [! Y        MyMACD( 0 ),
    5 y$ N  X3 f7 `; Z        MACDAvg( 0 ), . D- P5 E7 F- `- F
            MACDDiff( 0 );
    + h9 Z+ h5 j' P
      S0 Y$ m, |( @& m% B# ~8 }* AMyMACD = MACD( Close, FastLength, SlowLength );3 _, E6 q4 F. X8 ~
    MACDAvg = XAverage( MyMACD, MACDLength );
    9 Q8 w$ I+ ^9 g% k7 t6 e; WMACDDiff = MyMACD - MACDAvg;
    * ]7 q' r( I! k3 I  N
    $ e+ E. F; |7 M{ CB > 2 check used to avoid spurious cross confirmation at CB = 2 (at CB = 1,
    " Y# A' M, n% n  MyMACD and MACDAvg will be the same) }- q  w" z4 a) }: }  [
    if CurrentBar > 2 and MACDDiff crosses under 0 then # W) Z# l2 I  h8 S4 E/ v
            Sell Short ( !( "MacdSE" ) ) next bar at market;( b" a- _) _  X

    7 t4 r& i4 P- N! t/ q- y( [4 G2 s; {' ]' }
    { ** Copyright © TradeStation Technologies, Inc.  All Rights Reserved **
    * \$ ~5 w+ D; d  k  h  ** TradeStation reserves the right to modify or overwrite this strategy component
    0 L) J5 t) U0 S9 X8 a     with each release. ** }
    fx628外汇论坛提供现货黄金、白银投资交流平台、fxcm福汇外汇开户、来自华尔街最顶尖外汇分析软件,全球高频交易系统与策略,最新mt4平台下载、商业EA破解和技术指标。
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    
     
     
    点击这里给我发消息
    fx628官方群
    工作时间:
    8:30-23:00

    官方微信扫一扫
    FX628外汇论坛-您值得拥有,不必再东寻西找! 立即登录 立即注册

    QQ|黄金交易平台|现货白银投资|外汇交易平台|贵金属交易平台|外汇黄金投资|FX628外汇论坛 ( 粤ICP备15100332号-1 |网站地图  

    GMT+8, 2018-1-22 18:14

    Powered by Discuz! X3.2 Designed by fx628.com

    © 2001-2014 Comsenz Inc.

    快速回复 返回顶部 返回列表