+1 888 340 6572

Derivative Moving Average

From MultiCharts

Article/Author: Stocks&Commodities Magazine, Traders Tips, 02/1997

TAI FUNCTION CODE

INPUT: PRICE(NUMERIC),AVGLEN(NUMERIC),TAILEN(NUMERIC);

TAI = (HIGHEST(AVERAGE(PRICE,AVGLEN),TAILEN)- LOWEST(AVERAGE(PRICE,AVGLEN),TAILEN))*100/CLOSE


DERIVATIVE MOVING AVERAGE SIGNAL CODE

INPUT: PRICE(CLOSE),AVGLEN(28),LOWLEN(4),TAILEN(5),EXITLEV(.4);

IF MARKETPOSITION = 0 AND AVERAGE(PRICE, AVGLEN)[1] = LOWEST(AVERAGE(PRICE, AVGLEN),LOWLEN)[1] THEN BUY THIS BAR  ON CLOSE;

IF MARKETPOSITION = 1 AND TAI(PRICE, AVGLEN, TAILEN) CROSSES BELOW EXITLEV THEN SELL THIS BAR ON CLOSE;