Strategy Backtester
Backtesting: Ori Rise & Fall V2
Author: Rosenfeld
//@version=5
strategy("Ori Rise & Fall v2 Strategy", overlay=true, initial_capital=100000, default_qty_type=strategy.percent_of_equity, default_qty_value=10)
// הפרמטרים של האסטרטגיה
consecRiseBars = input.int(3, title="Consecutive Rise Bars", minval=1)
consecFallBars = input.int(3, title="Consecutive Fall Bars", minval=1)
breakoutPeriod = input.int(20, title="Breakout Lookback Period")
atrMult = input.float(2.5, title="ATR Trailing Stop Multiplier", step=0.5)
maxHoldBars = input.int(10, title="Max Holding Period (Bars)")
// חישוב רצפים
isRise = close > close[1]
isFall = close < close[1]
int riseStreak = 0
int fallStreak = 0
for i = 0 to consecRiseBars - 1
if isRise[i]
riseStreak := riseStreak + 1
for i = 0 to consecFallBars - 1
if isFall[i]
fallStreak := fallStreak + 1
// אינדיקטורים
highestHigh = ta.highest(high, breakoutPeriod)[1]
atrVal = ta.atr(14)
// תנאי כניסה
breakoutCond = close >= highestHigh
entryCondition = (riseStreak >= consecRiseBars) and breakoutCond
if (entryCondition and strategy.position_size == 0)
strategy.entry("Rise Long", strategy.long)
// ניהול יציאות
if (strategy.position_size > 0)
// 1. ATR Trailing Stop
trailStop = close - (atrVal * atrMult)
// 2. Time Exit
barsInTrade = bar_index - strategy.opentrades.entry_bar_index(0)
if (barsInTrade >= maxHoldBars)
strategy.close("Rise Long", comment="Time Exit")
else if (fallStreak >= consecFallBars)
strategy.close("Rise Long", comment="Fall Exit")
else
strategy.exit("ATR Stop", "Rise Long", stop=trailStop)
DataSet
Go to My DataSets to define your own DataSets (subscribers only!)
Data Range & Scale
The Web Backtester currently uses a Data Range of 10 years of daily data. We'll offer more options here in a future update.
Scale
Position Sizing
Starting Capital
Determines how much simulated capital your backtest starts with
Benchmark Symbol
Your strategy results will be compared with a buy and hold of this symbol
Margin Factor
Controls how much leverage to use in the simulated trading account
Sizing Method
Controls how many shares each simulated trade will have
Percent
Each trade will use this percentage of the current simulated account equity
| Metric | Strategy Results | Benchmark Results (SPY) |
|---|---|---|
| Starting Capital | 0.00 | 0.00 |
| Profit | 0.00 | 0.00 |
| Profit % | 0.00% | 0.00% |
| CAGR (Annualized % Return) | 0.00% | 0.00% |
| Exposure % | 0.00% | 0.00% |
| Sharpe Ratio | 0.00% | 0.00% |
| WealthLab Score | 0.00% | 0.00% |
| Number of Positions | 0.00% | 0.00% |
| Average Profit % | 0.00% | 0.00% |
| Profit Factor | 0.00% | 0.00% |
| Payoff Ratio | 0.00% | 0.00% |
| Average Bars Held | 0.00% | 0.00% |
| NSF (Non-Sufficient Funds) Position Count | 0.00% | 0.00% |
| Maximum Drawdown | 0.00% | 0.00% |
| Maximum Drawdown % | 0.00% | 0.00% |
| Recovery Factor | 0.00% | 0.00% |
| Win % | 0.00% | 0.00% |
| Year | Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec | Annual |
|---|
The most recent 100 Positions out of 1,234 total are presented here.
| Symbol | Position | Quantity | Entry Date | Entry Price | Exit Date | Exit Price | Bars Held | Profit | Profit % |
Signals are available to subscribers only. Click here to learn more about WealthLab subscription options!