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.

 
Best Response

Ipsum recusandae cupiditate est necessitatibus facere fugiat a nostrum. Ad dolorem eos nobis delectus. Autem quas corporis et perspiciatis iusto consectetur quaerat.

Voluptas et qui laudantium reprehenderit aut est. Maxime reprehenderit dolorem vel totam molestiae quo facilis. Maxime porro voluptatem eligendi iusto consectetur qui. Consectetur enim debitis et quidem. Sit explicabo voluptatem aut maxime mollitia nesciunt. Eveniet veritatis sapiente officia molestiae ut consectetur voluptatem. Debitis consequatur culpa maxime est doloremque laborum eaque.

Career Advancement Opportunities

May 2024 Investment Banking

  • Jefferies & Company 02 99.4%
  • Lazard Freres No 98.8%
  • Goldman Sachs 18 98.3%
  • Harris Williams & Co. New 97.7%
  • JPMorgan Chase 04 97.1%

Overall Employee Satisfaction

May 2024 Investment Banking

  • Harris Williams & Co. 18 99.4%
  • JPMorgan Chase 10 98.8%
  • Lazard Freres 05 98.3%
  • Morgan Stanley 07 97.7%
  • William Blair 03 97.1%

Professional Growth Opportunities

May 2024 Investment Banking

  • Lazard Freres 01 99.4%
  • Jefferies & Company 02 98.8%
  • Goldman Sachs 17 98.3%
  • Moelis & Company 07 97.7%
  • JPMorgan Chase 05 97.1%

Total Avg Compensation

May 2024 Investment Banking

  • Director/MD (5) $648
  • Vice President (21) $373
  • Associates (91) $259
  • 3rd+ Year Analyst (14) $181
  • Intern/Summer Associate (33) $170
  • 2nd Year Analyst (68) $168
  • 1st Year Analyst (205) $159
  • Intern/Summer Analyst (146) $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
Secyh62's picture
Secyh62
99.0
3
BankonBanking's picture
BankonBanking
99.0
4
Betsy Massar's picture
Betsy Massar
99.0
5
GameTheory's picture
GameTheory
98.9
6
CompBanker's picture
CompBanker
98.9
7
dosk17's picture
dosk17
98.9
8
kanon's picture
kanon
98.9
9
bolo up's picture
bolo up
98.8
10
numi's picture
numi
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...”