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

Commodi est hic culpa. Et fuga quae dolor voluptatem sapiente iure. Officia similique officiis id repellat ipsum voluptas cum. Veritatis sed explicabo esse est delectus dolores est. Eum dolor impedit eum provident tempore.

Voluptatem qui voluptatibus laboriosam at. Accusantium et perferendis beatae sed. Vel ab consectetur nesciunt temporibus id occaecati. Velit in et ab quo non.

Career Advancement Opportunities

August 2026 Investment Banking

  • Evercore 01 99.5%
  • Moelis & Company 01 98.9%
  • JPMorgan 01 98.4%
  • Morgan Stanley 08 97.8%
  • Goldman Sachs 02 97.3%

Overall Employee Satisfaction

August 2026 Investment Banking

  • Moelis & Company No 99.5%
  • Evercore No 98.9%
  • Morgan Stanley 01 98.4%
  • Banco Santander 02 97.8%
  • BMO Capital Markets 12 97.3%

Professional Growth Opportunities

August 2026 Investment Banking

  • Evercore 01 99.5%
  • Moelis & Company 01 98.9%
  • Morgan Stanley 06 98.4%
  • Goldman Sachs 01 97.8%
  • JPMorgan 01 97.3%

Total Avg Compensation

August 2026 Investment Banking

  • Vice President (16) $429
  • Associates (48) $259
  • 3rd+ Year Analyst (8) $210
  • 2nd Year Analyst (25) $178
  • Intern/Summer Associate (14) $159
  • 1st Year Analyst (83) $151
  • Intern/Summer Analyst (75) $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
dosk17's picture
dosk17
98.9
8
GameTheory's picture
GameTheory
98.9
9
DrApeman's picture
DrApeman
98.9
10
Linda Abraham's picture
Linda Abraham
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...”