StockFetcher Forums · General Discussion · EDGERATER discussion<< 1 2 3 4 5 >>Post Follow-up
graftonian
1,089 posts
msg #155235
Ignore graftonian
1/9/2021 9:56:40 AM

@Ed S.,
Here is a simple MA cross-over entry script:

market is sp500
close > ma(200)
ema(10) crossed above ema(50)

the exit would be a 10/50 cross-below

The aim here is:
1) Be able to code this in ER.
2) vary the lengths of the EMAs to optimize returns.

Thanks,
Duane

xarlor
585 posts
msg #155236
Ignore xarlor
1/9/2021 12:07:33 PM

Would like to see backtest results on this simple RSI(2) oversold filter.


Fetcher[
set{buy1,count(RSI(2) < 1,1)}
set{buy2,count(RSI(2) 1 day ago > 1,1)}
set{buy3,count(close > 1,1)}
set{buy4,count(volume > 2000000,1)}
set{buy5,buy1 * buy2}
set{buy6,buy5 * buy3}
set{buy,buy6 * buy4}
buy > 0

set{exit,count(rsi(2) > 70,1)}
exit > -1

draw rsi(2)
]



General rules:
Enter when RSI(2) < 1 today but not yesterday
Exit when RSI(2) > 70
No stop loss
stocks above $1 and at least 2 million in volume.


nibor100
1,042 posts
msg #155237
Ignore nibor100
1/9/2021 12:27:20 PM

I'll tackle these 2 requests, as one of them is what I volunteered to do for Graftonian during his 14 day trial of Edgerater, but I am not volunteering to do unlimited backtests in Edgerater for SF members as all of you can do your own Edgerater trials and run some backtests or buy/subscribe to the program to do the same.

Thanks,
Ed S.



graftonian
1,089 posts
msg #155239
Ignore graftonian
1/9/2021 12:57:48 PM

@Ed S,
I've watched Vid2 again and may be able to get through a simple script. Put my request on hold for a day or two.
Thanx

nibor100
1,042 posts
msg #155267
Ignore nibor100
1/12/2021 10:13:18 AM

@xarlor,

Here are backtest results from 1/11/11 as run on an base Edgerater Symbol List of 558 stocks that are CBOE Weeklys using your filter parameters:

All Trades Winners Losers Neutral
Trade Count 3278 2093 1179 6
Trade Count % 100% 63.85% 35.97% 0.18%
Avg. Profit/Loss $ $46.29 $373.70 ($534.68)
Avg. Profit/Loss % 0.46% 3.74% -5.35%

Average Min Max SD Sum
Trade Length (Days) 7.16 2.00 33.00 4.19
Trades per position 1.00 1.00 1.00 0.00 3278.00
Daily Open Positions 8.87 0.00 32.00 7.55
Profit/Loss (%) 0.46% -72.06% 93.41% 7.47%
Max Favourable Excursion % (MFEP) 3.66% 0.00% 93.41% 4.97%
Max Adverse Excursion % (MAEP) 5.20% 0.00% 84.87% 7.75%
Profit/Loss ($) $46.29 ($7,206.05) $9,340.66 $747.13 $151,752.51
Max Favourable Excursion (MFE) $366.33 $0.00 $9,340.66 $496.76
Max Adverse Excursion (MAE) $520.10 $0.00 $8,486.68 $774.66

Starting Equity $100,000
Ending Equity $251,753
Net Profit $151,753
Net Profit % 151.75%
Investment Period (Days) 3647
Maximum Equity $284,959
Minimum Equity $98,877
Max Consecutive Winners 23
Max Consecutive Losers 15
Commission Rate $0.00
Total Commissions Paid $0.00

Payoff Ratio 0.70
Expectation % 8.66%
Expectation $ $46

Annualized Rate of Return (ARR) 15.19%
Compounded Annual Growth Rate (CAGR) 9.68%
Profit Factor (PF) 1.24
Pessimistic Rate of Return (PRR) 1.18
Maximum Portfolio Drawdown (MPD) $139,173.85
Sharpe Ratio 20.1775

I set Edgerater to enter at the Open the next day after the signal and to exit the next day after the exit signal. Starting with $100K, $10K per trade, no duplicates allowed, trade using available equity

Looks like the Covid decline really took a toll on the prior gains of this backtest.

Let me know if you have any questions or changes wanted.

My Edgerater Entry Script: The N parameter is set to a default of 2

buy1: count(RSI(CLOSE, N) < 1, 1) ;
buy2: count(ref(RSI(CLOSE, N),1) > 1, 1);
buy3: count(c > 1,1);
buy4: count(vol > 2000000,1);
event: buy1 & buy2 & buy3 & buy4;

My Exit Script:

sellit1: count(RSI(CLOSE, N) > 70, 1) ;
sellit2: count(ref(RSI(CLOSE, N),1) < 70, 1);
event: sellit1 & sellit2 ;

Ed S.
:



Cheese
1,374 posts
msg #155272
Ignore Cheese
1/12/2021 11:46:22 AM

To: Ed S, xarlor, and any other helpful members

My learning question:

I am re-learning Kelly and I just want to make sure my learning is on on the right path
both in understanding Kelly and the test results above.

Given the above test results, is ONE KELLY = 6% of capital, approximately
if I were to use the above filter?

Thank you



nibor100
1,042 posts
msg #155275
Ignore nibor100
1/12/2021 12:50:55 PM

@Cheese,

I don't know anything at all about Kelly and I did not use any convention for limiting trades on the backtest whose results are show above: other than starting capitol of $100K and limiting positions to $10K a position as long as there was at least $10K of available equity.

For example, when the backtest started in 2011, it took 12 trading days before the initial $100K was put out in trades.
At peak there were 28 open trades in early Feb 2020, each with an initial value of $10K.

Ed S.



Cheese
1,374 posts
msg #155279
Ignore Cheese
1/12/2021 2:57:11 PM

Thank you, Ed.

xarlor
585 posts
msg #155283
Ignore xarlor
1/12/2021 6:23:56 PM

nibor, thank you so much for running this. Rest assured I would/will learn Edgewater's coding if I had time. I just don't right now nor will I at least until this summer. That is why I appreciate you running it for me to see the output of the software. I'm convinced it's something I want to get into for sure now.

If you want to play around with it, I do have a few edits.

  • RSI(2) trading is imperative that you enter at the close of the signal, not the open next day. It rather defeats the purpose of the strategy as the next day has a good chance of opening higher.
  • Similarly, you have to close the position at the close of the exit signal
  • Open the universe of stocks to all except ETFs, so long as > $1 and volume above 200,000,000.
  • Can you run the backtest with these capital settings?
    1. Starting with $100K, 2% NLV per trade (account value), no duplicates allowed, trade using available equity (no margin)

    Cheese, based on Kelly as I understand it, I am getting 12.5% of capital per trade.

  • Cheese
    1,374 posts
    msg #155287
    Ignore Cheese
    1/12/2021 8:27:14 PM

    Thank you, xarlor.
    Please let me know what win rate you use.

    StockFetcher Forums · General Discussion · EDGERATER discussion<< 1 2 3 4 5 >>Post Follow-up

    *** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


    Copyright 2022 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
    EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus


    This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.