Category Archives: Pivot Point System

First Attempt at Pivot-Based System

Carsten’s post about a simple pivot-based trading system was intriguing to me mainly because I have never tried to code such a system. I guessed that coding a proof-of-concept of the system would be pretty easy, and it was.

Here is the code for Tradestation:

inputs:
ATRLength( 10 ), // I used Average True Range as a substitute for Carsten’s “volatility.”
Length( 10 );

variables:
ATR( 0 ),
S1( 0 ),
R1( 0 ),
PP ( 0 );

ATR = AvgTrueRange( ATRLength ) ;
PP = close[1];
S1 = PP – ATR;
R1 = PP + ATR;
If close <= S1 then buy next bar at market;
If close >= R1 then sell short next bar at market;

If currentbar > 1 and marketposition = 1 and close = highest(close, 3) then sell (“LX”) next bar at market;
If currentbar > 1 and marketposition = -1 and close = lowest(close, 3) then buytocover (“SX”) next bar at market;

Here are the results and the equity curve. I assumed 10K starting equity, purchasing only one contract per trade, with no compounding of gains.

Not bad for a first pass. The equity curve is not nearly as nice as Carsten’s version, but again, this was more for practice than anything else.

Caveats:

I know very little about pivot points, how to calculate them, how to trade them, etc. I need to do much more reading on the subject.

I also know very little about trading S&P E-minis and need to complete more study on trading them as well.

This system can obviously be improved. Right now it suffered some large drawdowns and was underwater for well over 100 trades.

I’m hoping the collective wisdom of the community here can help produce an improved V1.1

Major US US Futures Europe Asia Commodities 2yr Euro Yields 10yr Euro Yields Oil
• DOW 15,307.20 -0.52%
• NASDAQ 3,463.30 -1.11%
• S&P 500 1,655.35 -0.83%
• VIX 13.82 3.37%
• SPX 500 (CFD) 1,658.60 0.20%
• DOW (CFD) 15,344.00 0.24%
• NASDAQ 100 3,007.50 0.28%
• EURUSD 1.286 0.01%
• UK 6,840.27 0.53%
• GERMANY 8,530.89 0.69%
• FRANCE 4,051.11 0.37%
• SPAIN 8,462.40 -0.02%
• H. KONG 23,260.00 -0.45%
• JAPAN 15,656.00 1.60%
• KOREA 1,993.83 0.64%
• SHANGHAI 2,302.40 -0.12%
• NAT GAS 4.18 -0.07%
• GOLD 1,368.30 0.07%
• SILVER 22.21 -1.11%
• COPPER 3.37 -0.34%
• FRANCE 2YR 0.19 -10.90%
• GERMAN 2YR 0.00 -128.57%
• ITALIAN 2YR 2.18 27.59%
• SPAIN 2YR 2.81 8.21%
• FRANCE 10YR 1.90 -0.37%
• GERMAN 10YR 1.43 2.59%
• ITALIAN 10YR 3.91 -0.31%
• SPAIN 10YR 4.18 -0.17%
• WTI 94.10 -0.19%
• BRENT 102.32 -1.53%
• WTI/BRENT 8.22
• 321 CR SPR 21.96 10.04%