// Downloaded From https://www.WiseStockTrader.com // TRIX chart and timing signal // You can use this to display the graph or change the parameter to show it as a buy/sell signal (default) // Changing the parameters allows you to use it for different timing periods and TRIX 25/8 is very close to Mercury. // Be careful to NOT name it TRIX or it may overlay ABs canned version. _SECTION_BEGIN("TRIX Timing"); tgl = ParamToggle("Plot type", "Signals|Graph", 1); // TRIX - 10 Periods, 5 Signal Periods tPeriods = Param("Periods", 17, 2, 100, 1 ); tSig = Param("Signal", 5, 2, 100, 1); //Plot(Trix(tPeriods), "Trix", colorRed); //Plot(Trix(tSig), "TrixSig", colorGreen);; myTrix = EMA(C, tPeriods ); myTrix1 = EMA(myTrix, tPeriods ); myTrix2 = EMA(myTrix1, tPeriods ); myTrix3 = (myTrix2 - Ref(myTrix2, -1)) / Ref(myTrix2, -1) ; myTrixSig = EMA(C, tSig ); myTrixSig1= EMA(myTrixSig , tSig ); myTrixSig2= EMA(myTrixSig1, tSig ); myTrixSig3 = (myTrixSig2- Ref(myTrixSig2, - 1)) / Ref(myTrixSig2, - 1); if(tgl) { Plot(myTrix3 * 1000, "TRIX(" + NumToStr(tPeriods,1.0) + ")", colorRed); Plot(myTrixSig3 * 1000, "Signal(" + NumToStr(tSig,1.0) + ")", colorGreen); } else { mySell = Cross(myTrix3, myTrixSig3); myBuy = Cross(myTrixSig3, myTrix3); Buy = ExRem(myBuy, mySell); Sell = ExRem(mySell, myBuy); Filter = Buy OR Sell; Plot(Buy, "TRIX(" + NumToStr(tPeriods,1.0) + ")", colorGreen); Plot(-Sell, "Signal(" + NumToStr(tSig,1.0) + ")", colorRed); } _SECTION_END();