My Buy and Sell Rules

Denny is right on both counts regarding the 0/1 switch.

First off, it’s easier to spot whether a rule is active or not just by looking at the first character.

Secondly, it’s easy to copy & paste the switch into all rules when developing a new sim.

Finally (with apologies for the cheap shot), without usiing the switch method, how would you deactivate these recently posted candidate rules?

(GainPct < -14 & Rank < 95) OR (GainPct < -20 & Rank < 98) OR Rank<90

or

Eval(HighestBar(#High,25,0)=1,1,0) OR Eval(HighestBar(#High,25,0)=2,1,0) OR Eval(HighestBar(#High,25,0)=3,1,0) OR Eval(HighestBar(#High,25,0)=4,1,0) OR Eval(HighestBar(#High,25,0)=5,1,0) OR Eval(HighestBar(#High,25,0)=6,1,0) OR Eval(HighestBar(#High,25,0)=7,1,0) OR Eval(HighestBar(#High,25,0)=8,1,0) OR Eval(HighestBar(#High,25,0)=9,1,0) OR Eval(HighestBar(#High,25,0)=10,1,0) OR Eval(HighestBar(#High,25,0)=11,1,0) OR Eval(HighestBar(#High,25,0)=12,1,0)

Denny & Jerrod,

I see the point you guys have made.

Naturally, the more complex buy and sell rules you guys create, the more likely that you guys will need additional features, like check boxes, just to be able to manage those highly complex rules.

Maybe I should use complex buy and sell rules, too. However, currently, I make serious attempts to keep them as simple as possible. I’m concerned about using too many rules, because too many (or too complex) rules mean data mining. And data mining usually leads to high sim returns, but low port returns. And if returns on my ports are low, then why did I go through this whole exercise (of creating complex buy and sell rules)? And, if I didn’t need the exercise, then why did I ask for the additional feature Marco has talked about?

I’m still undecided on this issue. As soon as I have some time, I will run a large number of sims, just to help me decide if I can keep all of my buy and sell rules simple. In my whole life, I’ve always tried to keep things simple.

But I see the point you guys have made.

Robert

Good morning Dan:

I’m rebalancing my portfolio and got a Sell on one of the stocks. The reason: Buy/Sell Difference. The rebalance didn’t replace thios sell order with a corresponding buy.

Any thoughts.

Judy G

judyg@mechanicalwoman.com

Hi Denny,

I would like to ask how to search for higher values of “Gain/Stk/Day” in Sims/Ports ?

Happy Trading
isam

Hi Isam,

The answer you require is contained on page 1 of this thread, in Denny’s post. Re-read his post and put your thinking cap on; and there, as far as I understand your question, you will likely find the answer.

:slight_smile:

Isam,

There is no way to search the public Sims or Ports for high values of Gain/Stock/Day.
You can narrow your search by adding a high value of Sortino Ratio such as 4.0 to your search criteria. Sims and Ports that have a high Gain/Stock/Day inevitably also have a high Sortino Ratio. Then you can calculate the Gain/Stock/Day from the Statistics; Trading page.

I have a Feature request to add the Gain/Stk/Day calculation to the Summery page. You can vote for it here:

http://www.portfolio123.com/feature_request.jsp?poll=249

Denny :sunglasses:

Hi Denny & jtbaccarat,

Thanks a lot for your highlight.

isam

Bumping this thread for beliving it can be extremely useful. Thank you very much for sharing!

Denny:

 Thanks for sharing so much. It's appreciated.

Best,

Bill

16 Years later… Thank you Denny.

Thank you, Mr. @AndorraInvestor , sir, for bringing this thread to the present and thus to my attention. I had been getting discouraged over the months because of my lack of progress and had considered leaving Portfolio 123. But in the past few weeks a lot of things have happened to make me think there is hope for me yet!

Thanks, again!

Cary

Thank you for sharing!!
It would be interesting if you could publish some screenshots of the strategy from the simulator, just to see how it does in terms of turnover, overall winners and annual returns?
And do you sometimes run into problems with your buy when using “AvgDailyTot(20)"? I see that sometimes stocks -that are almost non-buyable- can have very high volumes for short periods of time. How about Mediandailytot(120)>( 70* 1000) and StaleStmt = 0

I added the buy and sell rules indiscriminately in my test system with United States (Primary), but it did not give much better results in the period 06-22:


Could bee to much into cash:

Buy : Rank > 98 and Price > 1 and MktCap > 50 & MktCap < 500 and AvgDailyTot(20) > 100000 and Pr4W%ChgInd > 0
Sell : Rank < 99 or PctFromHi < -15 and GainPct < BenchPct & NoDays > 30 or Pr4W%Chg /20 < 0.1 & NoDays > 20

Original system, but with the buy AvgDailyTot(20) > 100000 and sell Rank < 99

I will keep on testing different settings :slight_smile: And again, thank you for sharing!

Thanks for sharing @Whycliffes !!
Seeing the very high annual turnover from your screenshots, wouldn’t it be more realistic to generate the simulation with VARIABLE SLIPPAGE?

I would be careful with too many rules. As you can see from your own backtests, it increases the annual turnover.
Also, rules like PctFromHi < -15 don’t make much sense in a small- to micro-cap universe as these stocks are very volatile and you might miss an upward trend following a 15-20% drawdown.
Most of my models only have one main sell rule (Rank < 98) and that allows me to keep the turnover to less than 400% per year.
hth,
Florian

Ive generally never backtested a successful stop loss strategy in terms of maximizing returns, but that said I’m of a firm belief that this game is as much about behavior as it is modeling. Being able to stomach volatility is as much of a gift in this game as any computational insights. So I do see value in getting out of a losing position if helps you put it behind you and stick to your model. I don’t have stop losses systematically enforced in my model, but I would be lying if I said I didn’t lose hope on a few in a 30% drawdown that seemed like lost causes along the way of a multi-year journey. The good news is there’s generally always a new stock with a 99+ ranking to get into that could be the next triple bagger. It’s become like adhering to a diet for me. I allow myself some cheat days here and there for the greater good of sticking to the diet over the long term.

Thanks! Yes, I completely agree. Unfortunately, until now I haven’t found much rules that give better results for the simulations I’ve run, besides rank<x

Are you already using PiotFScore > 1 ?

Hey @DennyHalwes!
I was just curious if after 16 years from your post you are still using the same Gain/Stock/Day metric, or you had evolved it or perfected another one. And If you could share a bit on your conclusions.

THANKS, and please excuse my cheeky curiosity.

All,

I may be a bit too late to post my own findings to the DennyHakwes’s buy and sell rules found in post #1, as I had to go out of town for a week. But here is I learned:

I decided to backtest his rules for 01/02/2002 (the earliest I can) to 01/01/2007 using the Core:Value ranking system (as it performs better with tighter Rank sell rules). Here is what I found:

But when I ran the simulation from 01/-2/2002 to present (12/13/2022) I got quite a bit different story:

So if my test was valid, then this is a prime example of a trading system that lost whatever edge it may have had.

Comments?

Cary

Thanks for posting Cary.

On the sims you shared, there are very few positions. In my experience, 5 position sims can test well (and live) for brief periods, but over the long term can fall apart. That said, I understand Denny did quite well with these back in the day.

Another test would be to check the Core: Value system without the buy/sell rules and compare performance, then you can see the impact of the buy/sell rules. I would also test with say 15-25 stocks as well. Could be the rules are better suited to growth, or quality. Or try a more balanced ranking system such as “Core: Combination”.

FWIW, I played with some of these buy/sell rules in my own sims and ports, but couldn’t find any notable improvement. That said, the concept of return/stock/day is interesting, I’ll need to delve into this further.

Cheers,
Ryan