Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

STOCK 1 - Check ✔

Mean Reversion(entry indicator):

Highline = highest(high, length)

Lowline = lowest(low, length)

Long signal = candle is closed and cross under(close, Lowline)

Short signal = candle is closed and crossover(close, Highline)

HH/LL lookback (exit indicator):

Highline = highest(high, length)

Lowline = lowest(low, length)

Long Exit Signal = candle is closed and close > Highline

Short Exit Signal = candle is closed and close < Lowline

Note: this is the exact same code as the Mean Reversion entry indicator but should use its own input
parameter for the length argument. Its best to make a function out of the code and call twice, once
for the entry and once for the exit, both with their own input parameter for the length argument.

Pyramiding Trades

Pyramiding trades is an input which has te set the amount of trades that can be open simultaneously.
Note that this means that if a maximum has already been met that no new trade can be opened until
a previous one has been closed due to either a stop loss hit or an exit indicator signal.

Enter Long trade if:

⮚ Mean reversion Long Signal

(AND)

⮚ Close > Baseline PWMA (based on close) [conformation]

(AND)

⮚ ATR < SMA (based on ATR) [conformation]

AND

⮚ Candle is closed (open trade on next candle)

Enter Short trade if:


⮚ Mean reversion Short Signal

AND

⮚ Close < Baseline PWMA (based on close) [conformation]

AND

⮚ ATR < Baseline SMA (based on ATR) [conformation]

AND

⮚ Candle is closed

Exit Long Trade if:

⮚ HH/LL Lookback Long Exit Signal

Exit Short Trade if:

⮚ HH/LL Lookback Short Exit Signal

Stop-loss:

Long Stop-loss = entry price – (ATR X ATR multiplier input)

Short Stop-Loss = entry price + (ATR X ATR multiplier input)

Position size:

Risk per trade Equals position size times stop loss distance (input risk % per trade)

Name input Value Start Stop Step

Entry Indicator: INTEGER INTEGER INTEGER INTEGER


Mean Reversion
Length

Confo Baseline SOURCE


PWMA: Source

Confo Baseline INTEGER


PWMA: Length

Confor Baseline INTEGER


PWMA: Power

Confor ATR: ATR INTEGER


Length

Confor ATR: SMA INTEGER


Length

Exit Indicator: INTEGER


HH/LL lookback
length

ATR Length INTEGER

ATR Stop Loss FLOAT


Multiplier

Position Risk % FLOAT

Pyramiding INTEGER
Trades

Take Long BOOLEAN


Trades?

Take Short BOOLEAN


Trades?

You might also like