Announcement

Collapse
No announcement yet.

T-3 MACD BB Lines

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • T-3 MACD BB Lines

    Could someone tell me, if this gonna work? Or could someone adjust it because of the SyntaxError?

    {
    ***** Study name: 'T-3 MACD BB Lines'
    }
    { ***** DLLs Section ***** }
    DefineDLLFunc: "c:\Program Files\eSignal\NexGen.dll", INT, "nexGen_noContextInit", IEasyLanguageObject ,FLOAT ;
    DefineDLLFunc: "c:\Program Files\eSignal\NexGen.dll", FLOAT, "t3FibsProTrader_bbMacd_1", FLOAT ,FLOAT ,FLOAT ,FLOAT ,FLOAT ,FLOAT ,FLOAT ,LPFLOAT ,LPFLOAT ,LPFLOAT ,LPFLOAT ,LPFLOAT ,LPFLOAT ,LPFLOAT ,LPFLOAT ,LPFLOAT ,LPFLOAT ,LPFLOAT ,LPFLOAT ,LPFLOAT ;
    DefineDLLFunc: "c:\Program Files\eSignal\NexGen.dll", FLOAT, "t3FibsProTrader_bbMacd_2", FLOAT ,FLOAT ,FLOAT ,FLOAT ,FLOAT ,FLOAT ,FLOAT ,FLOAT ,FLOAT ,FLOAT ,LPFLOAT ,LPFLOAT ,LPFLOAT ,LPFLOAT ,LPFLOAT ;
    DefineDLLFunc: "c:\Program Files\eSignal\NexGen.dll", BOOL, "t3FibsProTrader_queryEventHit", IEasyLanguageObject ,FLOAT ;
    DefineDLLFunc: "c:\Program Files\eSignal\NexGen.dll", INT, "t3FibsProTrader_setEventHit", IEasyLanguageObject ,FLOAT ;
    DefineDLLFunc: "c:\Program Files\eSignal\NexGen.dll", INT, "t3FibsProTrader_resetEventHit", IEasyLanguageObject ,FLOAT ;
    { ***** INPUTs Section *****}
    Inputs: PosColor(65280), NegColor(255);
    { ***** VARs Section ***** }
    Variables: fastLen(12), mmLen(34), slowLen(26), length(10);
    Variables: stDv(1), average1(32), average2(5), smooth(5);
    Variables: up(FALSE), dn(FALSE), crossUp(FALSE), crossDn(FALSE);
    Variables: zeroColor(16777215), bbMacd(0), upperBand(0), lowerBand(0);
    Variables: dif(0), sd(0), t3ts(0), s01(0), s02(0);
    Variables: s1(0), s21(0), s22(0), s23(0), p2(0);
    Variables: p3(0), x01(0), x02(0), x1(0), x21(0);
    Variables: x22(0), x23(0), x31(0), x32(0), x33(0);
    Variables: m(0), ii(0), posNeg(0), value0(0);
    { ***** ARRAYs Section *****}
    { ***** CODE Section ***** }
    #EVENTS OnDestroy = EasyLanguageRtlOnDestroy ;
    #END ;
    SETPLOTWIDTH (4, 2) ;
    SETPLOTCOLOR (4, zeroColor) ;
    if (CurrentBar = 1) then
    begin
    p2 = CLOSE-CLOSE[1] ;
    p3 = AbsValue (p2) ;
    x01 = CLOSE ;
    x02 = CLOSE ;
    value0 = nexGen_noContextInit (SELF, DATE) ;
    value0 = t3FibsProTrader_bbMacd_1 (fastLen, slowLen, length, average1, average2, p2, p3, & s01, & s02, & s1, & s21, & s22, & s23, & x1, & x21, & x22, & x23, & x31, & x32, & x33) ;
    end ELSE
    begin
    p2 = CLOSE-CLOSE[1] ;
    p3 = AbsValue (p2) ;
    x01 = x01[1]+s01*(CLOSE-x01[1]) ;
    x02 = x02[1]+s02*(CLOSE-x02[1]) ;
    dif = x01-x02 ;
    x1 = x1[1]+s1*(dif-x1[1]) ;
    x21 = x21[1]+s21*(p2-x21[1]) ;
    x22 = x22[1]+s22*(x21-x22[1]) ;
    x23 = x23[1]+s23*(x22-x23[1]) ;
    x31 = x31[1]+s21*(p3-x31[1]) ;
    x32 = x32[1]+s22*(x31-x32[1]) ;
    x33 = x33[1]+s23*(x32-x33[1]) ;
    end ;

    if (length > 0) then
    begin
    m = 0 ;
    sd = 0 ;
    FOR ii = 0 TO length-1
    begin
    m = m+dif[ii] ;
    end ;

    FOR ii = 0 TO length-1
    begin
    sd = sd+((dif[ii]-(m/length))*(dif[ii]-(m/length))) ;
    end ;

    sd = SquareRoot (sd/length) ;
    end ;

    value0 = t3FibsProTrader_bbMacd_2 (CurrentBar, smooth, stDv, x01, x02, x1, x23, x33, t3ts[1], sd, & bbMacd, & upperBand, & lowerBand, & t3ts, & posNeg) ;
    PLOT1 (bbMacd, "BB MACD") ;
    PLOT5 (bbMacd, "Shadow") ;
    PLOT6 (bbMacd, "Connect") ;
    PLOT2 (upperBand, "Upper") ;
    PLOT3 (lowerBand, "Lower") ;
    PLOT4 (0, "ZeroLine") ;
    if (posNeg > 0) then SETPLOTCOLOR (1, PosColor) ;
    if (posNeg < 0) then SETPLOTCOLOR (1, NegColor) ;
    if (PLOT1 >= 0) then SETPLOTCOLOR (4, 8388608) ;
    if (PLOT1 < 0) then SETPLOTCOLOR (4, 128) ;
    if (PLOT1 CROSS OVER PLOT2) then
    begin
    up = TRUE ;
    dn = FALSE ;
    end ;

    if (PLOT1 CROSS UNDER PLOT3) then
    begin
    up = FALSE ;
    dn = TRUE ;
    end ;

    if (up AND dn[1]) then
    begin
    if t3FibsProTrader_queryEventHit (SELF, 1) = FALSE then
    begin
    ALERT ("Crossing Above Upper Band") ;
    t3FibsProTrader_setEventHit (SELF, 1) ;
    t3FibsProTrader_resetEventHit (SELF, 2) ;
    end ;

    end ;

    if (dn AND up[1]) then
    begin
    if t3FibsProTrader_queryEventHit (SELF, 2) = FALSE then
    begin
    ALERT ("Crossing Below Lower Band") ;
    t3FibsProTrader_setEventHit (SELF, 2) ;
    t3FibsProTrader_resetEventHit (SELF, 1) ;
    end ;

    end ;

    if (crossUp AND PLOT1 CROSS UNDER 0.050000) then
    begin
    if t3FibsProTrader_queryEventHit (SELF, 3) = FALSE then
    begin
    ALERT ("Watch for Bullish ZLR") ;
    t3FibsProTrader_setEventHit (SELF, 3) ;
    t3FibsProTrader_resetEventHit (SELF, 4) ;
    end ;

    end ;

    if (crossDn AND PLOT1 CROSS OVER-0.050000) then
    begin
    if t3FibsProTrader_queryEventHit (SELF, 4) = FALSE then
    begin
    ALERT ("Watch for Bearish ZLR") ;
    t3FibsProTrader_setEventHit (SELF, 4) ;
    t3FibsProTrader_resetEventHit (SELF, 3) ;
    end ;

    end ;

    if (PLOT1 CROSS OVER 0.050000) OR (crossUp AND PLOT1 > 0.050000) then
    begin
    crossUp = TRUE ;
    crossDn = FALSE ;
    end ;

    if (PLOT1 CROSS UNDER-0.050000) OR (crossDn AND PLOT1 <-0.050000) then
    begin
    crossUp = FALSE ;
    crossDn = TRUE ;
    end ;

    {
    *
    *
    }
Working...
X