AFL for Trix on amibroker

#1
Friends,

I am very new to amibroker and I am successfully to import NSE bhav data from NSE, Now.

a) I want to enable OVERLAYs Boolinger bands
b) Indicators with TRIX with buy/sell signal based on EOD
c) chart type with candle sticks

I have got below code from online for trix but I dont know how to exceute so please help me.

Code:
// 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();
Please help me !!!
 
#2
Friends,

it worked out for me ....In case any newbie wanna use the same can.

please open your amibroker and the go to tools -> formula edit -> past the code and save ...that it you will see new chart on your system....
 

Similar threads