|
|
Trading
Systems
Key Reversals
Chad Payne
|
Name: |
Key Reversals |
|
Submitted by: |
Mike
Derr |
|
Periodicity: |
Intraday |
|
Rules... |
|
RULE 1: 3 Minutes: If Show_Variable then NO ACTION-TEST mode is OFF
SIGNAL=Show_Variable: SHOW(STOP) and SHOW(V#2); and SHOW(MACD1); and
SHOW(CL-ENTRY); and SHOW(STOP) and SHOW(ENTRY)
ELEM=V#3:Short Stop 3 pts
ELEM=CL:Close
ELEM=STOP:Stop Price
ELEM=ENTRY:Entry price
ELEM=ENTRY:Entry price
ELEM=V#1:Long Stop 3 pts
ELEM=V#2:Long Stop to +0.5
ELEM=STOP:Stop Price
RULE 2: 3 Minutes: If Set_Trade_Values then NO ACTION
SIGNAL=Set_Trade_Values: SET(V#10,3) AND SET(V#11,4) AND SET(V#12,3)
AND SET(V#13,0.5) ; V#10 is initial STOP amount, V#11 is initial
TARGET amount, V#12 is BE_MOVER constant, V#13 is BE_FACTOR constant
ELEM=V#10:Long Target 4 pts
ELEM=V#11:Short Target 4 pts
ELEM=V#12:V#12
ELEM=V#13:V#13
RULE 3: 3 Minutes: If MACD_BUY_SIGNAL then REVERSE-COVER & BUY 1 at Last price
SIGNAL=MACD_BUY_SIGNAL: TIME > 0930 AND TIME < 1600 AND ( MACD1 <= 0
and MACD > 0 )
ELEM=MACD:MACD Oscillator:MACD Oscillator [Scan] (EC12, 26, 3)
ELEM=TIME:Backtest Time (hhmm)
RULE 4: 3 Minutes: If Set_Stop_L then NO ACTION
SIGNAL=Set_Stop_L: IF ( POS_STATE=1 ) THEN ( SET(STOP,ENTRY-V#10));
AND SET(V#2,ENTRY+V#11) ) ; V#10 is STOP constant
ELEM=STOP:Stop Price
ELEM=POS_STATE:Backtest state 1=long 2=short
ELEM=ENTRY:Entry price
ELEM=V#10:Long Target 4 pts
ELEM=V#2:Long Stop to +0.5
ELEM=V#11:Short Target 4 pts
RULE 5: 3 Minutes: If Set_Target_L then NO ACTION
SIGNAL=Set_Target_L: IF ( POS_STATE=1 ) THEN ( SET(V#2,ENTRY+V#11) )
; V#11 is TARGET constant
ELEM=POS_STATE:Backtest state 1=long 2=short
ELEM=ENTRY:Entry price
ELEM=V#2:Long Stop to +0.5
ELEM=V#11:Short Target 4 pts
RULE 6: 3 Minutes: If State_Long then CONFIRM using next rule
SIGNAL=State_Long: POS_STATE=1; sys is long
ELEM=POS_STATE:Backtest state 1=long 2=short
RULE 7: 3 Minutes: If Set_BE_Stop_L then NO ACTION
SIGNAL=Set_BE_Stop_L: IF (CL>=(ENTRY+V#12) ) THEN
(SET(STOP,ENTRY+V#13)) ; V#12 is BE_MOVER constant, V#13 is BE_FACTOR
constant; IF (POS_STATE=1 and CL>=(ENTRY+3) ) THEN
(SET(STOP,ENTRY+0.5))
ELEM=CL:Close
ELEM=ENTRY:Entry price
ELEM=STOP:Stop Price
ELEM=POS_STATE:Backtest state 1=long 2=short
ELEM=V#13:V#13
ELEM=V#12:V#12
RULE 8: 3 Minutes: If Stopped_L then SELL at Stop price
SIGNAL=Stopped_L: IF ( POS_STATE=1 ) THEN ( CL<=STOP )
ELEM=CL:Close
ELEM=STOP:Stop Price
ELEM=POS_STATE:Backtest state 1=long 2=short
RULE 9: 3 Minutes: If Target_L then SELL at Value V#2 price
SIGNAL=Target_L: IF ( POS_STATE=1 ) THEN ( CL>=V#2 )
ELEM=CL:Close
ELEM=V#2:Long Stop to +0.5
ELEM=POS_STATE:Backtest state 1=long 2=short RULE 10: 3 Minutes: If MACD_SELL_SIGNAL then REVERSE-SELL & SELL
SHORT 1 at Last price
SIGNAL=MACD_SELL_SIGNAL: TIME > 0930 AND TIME < 1600 AND ( MACD.1 > 0
and MACD <= 0 )
ELEM=MACD:MACD Oscillator:MACD Oscillator [Scan] (EC12, 26, 3)
ELEM=TIME:Backtest Time (hhmm)
RULE 11: 3 Minutes: If Set_Stop_S then NO ACTION
SIGNAL=Set_Stop_S: IF ( POS_STATE=2 ) THEN ( SET(STOP,ENTRY+V#10) ) ;
V#10 is STOP constant
ELEM=STOP:Stop Price
ELEM=POS_STATE:Backtest state 1=long 2=short
ELEM=ENTRY:Entry price
ELEM=V#10:Long Target 4 pts
RULE 12: 3 Minutes: If Set_Target_S then NO ACTION
SIGNAL=Set_Target_S: IF ( POS_STATE=2 ) THEN ( SET(V#4,ENTRY-V#11) )
; V#11 is TARGET constant
ELEM=POS_STATE:Backtest state 1=long 2=short
ELEM=ENTRY:Entry price
ELEM=V#11:Short Target 4 pts
ELEM=V#4:Short Stop to +0.5
RULE 13: 3 Minutes: If State_Short then CONFIRM using next rule
SIGNAL=State_Short: POS_STATE=2 ; sys is short
ELEM=POS_STATE:Backtest state 1=long 2=short
RULE 14: 3 Minutes: If Set_BE_Stop_S then NO ACTION
SIGNAL=Set_BE_Stop_S: IF (CL<=(ENTRY-V#12) ) THEN
(SET(STOP,ENTRY-V#13)); V#12 is BE_MOVER constant, V#13 is BE_FACTOR
constant; IF (POS_STATE=1 and CL<=(ENTRY-3) ) THEN
(SET(STOP,ENTRY-0.5))
ELEM=CL:Close
ELEM=ENTRY:Entry price
ELEM=STOP:Stop Price
ELEM=V#12:V#12
ELEM=V#13:V#13
RULE 15: 3 Minutes: If Stopped_S then COVER SHORT at Stop price
SIGNAL=Stopped_S: IF ( POS_STATE=2 ) THEN ( CL>=STOP )
ELEM=CL:Close
ELEM=STOP:Stop Price
ELEM=POS_STATE:Backtest state 1=long 2=short
RULE 16: 3 Minutes: If Target_S then COVER SHORT at Value V#4 price
SIGNAL=Target_S: IF ( POS_STATE=2 ) THEN ( CL<=V#4 )
ELEM=CL:Close
ELEM=POS_STATE:Backtest state 1=long 2=short
ELEM=V#4:Short Stop to +0.5
RULE 17: 3 Minutes: If EOD_L then SELL at Last price
SIGNAL=EOD_L: TIME>=1605 AND POS_STATE=1; Long so sell to cover
ELEM=TIME:V#96
ELEM=POS_STATE:V#86
RULE 18: 3 Minutes: If EOD_S then COVER SHORT at Last price
SIGNAL=EOD_S: TIME>=1605 AND POS_STATE=2; Short so buy to cover
ELEM=TIME:V#96
ELEM=POS_STATE:V#86 |
|
Explanation and Comments... |
|
I have developed this since
Investor/RT has had backtesting. And I thank Bill for few pointers I
needed in the beginning. So for all to learn from my efforts, and
Bill's pointers, I'm sharing this now.
You can learn by example. I will not go into detail of every rule, print this out, read it, study it and we can discuss things as
needed.
A few things to note though:
* Designed as intraday backtest.
* There is one BUY rule (Rule 3) and one SELL rule (Rule 10)! I have
used MACD crossing 0.
* Can easily test a RSI, STOC, slope changes, MA crosses etc...
simply by replacing these two rules!
* note I have time constraints in the Buy and Sell rules! Also the 2
end of day rules to exit either position!
* Rule1 is for debugging to show variables
* Rule2: this is a great one! It has 4 constants/variables! initial
stop, target, point gained then move stop, new stop constants! Today
I've been "optimizing" results today! It's been great fun. I simple
change these 4 values and save rule, then hit backtest button, and
bango. I documented results. Been 30% to 70% in my experimenting!
Well it might be a bit complicated but study it and follow the
steps. It is not that complicated really! In summary, it takes a position, sets stop
and target. If gained x points moves stop to break even + factor,
then stopped rule, and target rule then repeats for sell side.
So
that's it in a nutshell.
Enjoy
Mike____
|
|