u33m2ha8
 ( 0.00% )
- ago
Good evening again.

Here are some questions about how I can incorporate various trading instructions into one block:

1. A trade should be closed if the closing price is below the 200-day simple moving average (SMA) for more than two days.

2. A trade should be closed if the price has risen by more than 25% in a single day, meaning today's closing price > yesterday's closing price * 1.25.

3. Number of closing prices over the last 2500 days.

4. Trading volume (currency) greater than 20 million per day on average over the last 21 trading days.

Thank you.
0
131
Solved
7 Replies

Reply

Bookmark

Sort
Glitch8
 ( 11.86% )
- ago
#1
1. A trade should be closed if the closing price is below the 200-day simple moving average (SMA) for more than two days.
- Indicator Compare to Indicator (Close < SMA200)
- Add the Qualifier for N Consecutive Days (2)

2. A trade should be closed if the price has risen by more than 25% in a single day, meaning today's closing price > yesterday's closing price * 1.25.
- Indicator Compare to Value (ROC(1) > 25)

3. Number of closing prices over the last 2500 days.
- ? I don't understand this one

4. Trading volume (currency) greater than 20 million per day on average over the last 21 trading days.
- SMA(Volume,20) > 20,000,000
0
u33m2ha8
 ( 0.00% )
- ago
#2
Regarding point 3): That the stock has at least 2500 closing prices (and is therefore tradable for approximately 10 years)
0
Glitch8
 ( 11.86% )
- ago
#3
Ah ok. One way I can think of would be to test if SMA(2500) > 0
0
- ago
#4
QUOTE:
to test if SMA(2500) > 0
@Glitch
I'm reading the goal of this inquiry entirely differently than you are. I "think" the poster wants to be sure there's position turnover for every trading day for the last 10 years; 250*10=2500. But I could be wrong.

I would suggest he alternatively watches the recent trading Volume of the stock instead to make sure there's sufficient trading activity. Something like ADX(Volume,22) for an indicator might work. I do something like this for my stock screener, but I've never done anything like this for a trading strategy.
0
u33m2ha8
 ( 0.00% )
- ago
#5
@Glitch

"Ah, okay. Eine Möglichkeit, die mir einfällt, wäre zu prüfen, ob SMA(2500) > 0"


That doesn't work because a backtest only starts once all the indicators are built up, so the backtest can't begin until after 2500 days, which is rather pointless.

Is there another way? Perhaps a higher number of price movements than 2500, or a first close older than: ?

Thanks!
0
Glitch8
 ( 11.86% )
- ago
#7
I think using the Qualifier "N Bars Ago" should accomplish this.

0
Best Answer

Reply

Bookmark

Sort