Sp%R
From MultiCharts
Article/Author: Omega research Inc., 1997
Description: This strategy based on SwingLow and Percent R. AddTime Function Code:
{ USER FUNCTION: ADDTIME
INPUTS : XTIME - TIME IN 24 HOUR FORMAT.
MINUTES - AMOUNT TO ADD/SUBTRACT TO XTIME.
SAMPLE USAGE :
IF (TIME[0] > ADDTIME (SESS1STARTTIME, +30))
THEN ...
RETURNS: ADJUSTED TIME IN 24 HOUR FORMAT.
PROPERTIES
[ ] AUTO DETECT
[*] SIMPLE
[ ] SERIES
PROVIDED BY PRODUCT SUPPORT DEPT.
OF OMEGA RESEARCH, INC. }
INPUTS : XTIME (NUMERICSIMPLE),
MINUTES (NUMERICSIMPLE) ;
ADDTIME = MINUTESTOTIME (TIMETOMINUTES (XTIME) + MINUTES) ;
Sp%R Signal Code
VALUE1=SWINGLOWBAR(2,PERCENTR(5),1,5);
VALUE2=SWINGLOWBAR(1,PERCENTR(5),1,5);
IF TIME < 1530 THEN BEGIN
IF VALUE1 > -1 AND PERCENTR(5)[VALUE1] <= 10 THEN BEGIN
IF CLOSE-LOWEST(LOW,4)<100 POINTS THEN BEGIN
IF LOW[VALUE2]<LOW[VALUE1] THEN BEGIN
IF VALUE2>0 AND LOW>LOW[VALUE2] THEN BUY NEXT BAR AT MARKET;
END;
END;
END;
END;
SELL("LOW") NEXT BAR AT LOWEST(LOW,4)-5 POINTS STOP;
IF BARSSINCEENTRY>0 THEN SELL("100LIM") NEXT BAR AT ENTRYPRICE + 100 POINTS LIMIT;
IF BARSSINCEENTRY>0 AND TIME>=ADDTIME(ENTRYTIME,60) THEN SELL("TIME") NEXT BAR AT MARKET;
VALUE3=SWINGHIGHBAR(2,PERCENTR(5),1,5);
VALUE4=SWINGHIGHBAR(1,PERCENTR(5),1,5);
IF TIME < 1530 THEN BEGIN
IF VALUE3 > -1 AND PERCENTR(5)[VALUE3] >= 90 THEN BEGIN
IF HIGHEST(HIGH,4)-CLOSE<100 POINTS THEN BEGIN
IF HIGH[VALUE4]>HIGH[VALUE3] THEN BEGIN
IF VALUE4>0 AND HIGH<HIGH[VALUE4] THEN SELL NEXT BAR AT MARKET;
END;
END;
END;
END;
BUYTOCOVER("HIGH") NEXT BAR AT HIGHEST(HIGH,4)+5 POINTS STOP;
IF BARSSINCEENTRY>0 THEN BUYTOCOVER ("100SH") NEXT BAR AT ENTRYPRICE - 100 POINTS LIMIT;
IF BARSSINCEENTRY>0 AND TIME>=ADDTIME(ENTRYTIME,60) THEN BUYTOCOVER("TIMESH") NEXT BAR AT MARKET;
PRINT(DATE,VALUE1,VALUE2);