Relative vigor Index

Can someone help me in programming the Relative vigor index of period 8 in pi software in th etradescript Language. I want only an alert for buy and sell signal. The profit and loss i will book it by myself.