Please Help - AmiBroker Signal Invert.

#1
Hello all there,

How can I get this code to invert (just the Wave signal only, not invert the price pattern) so what I able to see on the screen is the opposite of the code.

Thank you very much & Wishing all the very best lucks



:clap:



My code is following:


_SECTION_BEGIN("System Parameters");


SwingTrd1 = 100 * (Close - ((MA(C, 2) +

MA(MA(C, 2), 2)+
MA(MA(MA(C, 2), 2), 2) +
MA(MA(MA(MA(C, 2), 2), 2), 2) +
MA(MA(MA(MA(MA(C, 2), 2), 2), 2), 2) +
MA(MA(MA(MA(MA(MA(C, 2), 2), 2), 2), 2), 2) +
MA(MA(MA(MA(MA(MA(MA(C, 2), 2), 2), 2), 2), 2), 2)+
MA(MA(MA(MA(MA(MA(MA(MA(C, 2), 2), 2), 2), 2), 2), 2), 2)+
MA(MA(MA(MA(MA(MA(MA(MA(MA(C, 2), 2), 2), 2), 2), 2), 2), 2), 2)+
MA(MA(MA(MA(MA(MA(MA(MA(MA(MA(C, 2), 2), 2), 2), 2), 2), 2), 2), 2), 2)) / 10)) / (HHV(C, 10) - LLV(C, 10));

SwingTrd2 = EMA(SwingTrd1, 38.20);
SwingTrd3 = EMA(SwingTrd2, 38.20);

Bull_Trend = EMA(SwingTrd1, 78.60) > (0);
Bear_Trend = EMA(SwingTrd1, 78.60) < (0);

Impulse_Up = EMA(SwingTrd1, 38.20) > (0);
Impulse_Down = EMA(SwingTrd1, 78.60) < (0);

//==================================================
// Periodic Cycle
//==================================================


P = ParamField("Price Field", -1);

T3MAP = Param("Convensional Signal Periods", 32, 2, 300, 1, 10); // One and Half Month Conventional Signal Periods //

function T3(Price, Periods)

{

S = (0.84);

E1 = EMA(Price, Periods);
E2 = EMA(E1, Periods);
E3 = EMA(E2, Periods);
E4 = EMA(E3, Periods);
E5 = EMA(E4, Periods);
E6 = EMA(E5, Periods);

C1 = (-S * S * S);
C2 = (3 * S * S + 3 * S * S * S);
C3 = (-6 * S * S - 3 * S - 3 * S * S * S);
C4 = (1 + 3 * S + S * S * S + 3 * S * S);

TI3 = (C1 * E6 + C2 * E5 + C3 * E4 + C4 * E3);
return (TI3);

}

Csignal = T3(P, T3MAP); // Conventional Signal //

//==================================================
// Pattern Plots vs. Color Selections
//==================================================

Col = IIf( Csignal > Ref( Csignal, -1 ), colorCustom10, colorLightYellow );
Plot( Csignal, "Conventional Signal", col, styleLine||styleNoLabel|styleThick);

Bar_kol = IIf(Impulse_UP, colorGreen , IIf(Impulse_Down, colorCustom5 ,IIf(Bull_Trend, colorCustom4, colorCustom5 )));
Plot(Close, "Bar Chart Price Patterns", Bar_kol, styleBar|styleThick );


//==================================================
// Title Display
//==================================================

Title = EncodeColor(colorPaleGreen )

+ "Csignal. " + Csignal + EncodeColor(colorLightYellow );


_SECTION_END();


 

Similar threads