Excel Help - Back test some data

hoping someone can help me out with this no doubt trivial problem

I am trying to back test some data in excel and getting the exit to determine profitability of a trading system is proving quite difficult, hoping someone with better excel skills can help with this .

So I want to enter the position say if the closing price on day 0 is below say the 20 day simple moving average, which is simple I get how to figure that out, but the exit of the system is a little more complicated I want to exit on the first profitable day.

so say the first day after is positive then I would want to exit then at the closing price, if it is not positive I would hold out until day 2 and exit then.If day 2 is positive (from your entry price on the close of day 0) . If day 2 is not positive then is goes to day 3 etc until you get a positive exit or 10 days pass in which case you would just sell and take a loss if that is the case.

I appreciate any input, I have been trying to do this if multiple if statements just cant get there.

3 Comments
 
Best Response

Numquam eos animi aspernatur consectetur omnis porro. Quia rerum repudiandae repudiandae dolore voluptas quae qui. Et quo odio molestiae est excepturi.

Career Advancement Opportunities

June 2026 Investment Banking

  • Evercore 01 99.4%
  • Moelis & Company 01 98.9%
  • JPMorgan 01 98.3%
  • Guggenheim Partners 01 97.7%
  • Morgan Stanley 07 97.1%

Overall Employee Satisfaction

June 2026 Investment Banking

  • Moelis & Company No 99.4%
  • Morgan Stanley 02 98.8%
  • Evercore 01 98.3%
  • BMO Capital Markets 12 97.7%
  • Banco Santander 01 97.1%

Professional Growth Opportunities

June 2026 Investment Banking

  • Evercore 01 99.4%
  • Moelis & Company 01 98.9%
  • Morgan Stanley 06 98.3%
  • Goldman Sachs 01 97.7%
  • JPMorgan No 97.1%

Total Avg Compensation

June 2026 Investment Banking

  • Vice President (15) $434
  • Associates (44) $258
  • 3rd+ Year Analyst (8) $210
  • 2nd Year Analyst (22) $179
  • Intern/Summer Associate (13) $156
  • 1st Year Analyst (79) $150
  • Intern/Summer Analyst (73) $101
notes
16 IB Interviews Notes

“... there’s no excuse to not take advantage of the resources out there available to you. Best value for your $ are the...”

Leaderboard

1
redever's picture
redever
99.2
2
BankonBanking's picture
BankonBanking
99.0
3
kanon's picture
kanon
99.0
4
Secyh62's picture
Secyh62
99.0
5
CompBanker's picture
CompBanker
98.9
6
Betsy Massar's picture
Betsy Massar
98.9
7
DrApeman's picture
DrApeman
98.9
8
dosk17's picture
dosk17
98.9
9
GameTheory's picture
GameTheory
98.9
10
bolo up's picture
bolo up
98.8
success
From 10 rejections to 1 dream investment banking internship

“... I believe it was the single biggest reason why I ended up with an offer...”