Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Help to run a simple strategy

Hi guys,
I am new in Quantipian and have no programming skills. I would need help in coding and backtesting a strategy with the following items:

  • When ETF RSP crosses above 75 SMA Daily line: BUY ETF PDP
  • When ETF RSP crosses below 75 SMA Daily line: GO TO CASH SELLING PDP POSITION

I assume this should be an easy strategy to code. Unfortunately I do not have the time to learn Phyton as my MBA (Columbia) is becoming very time intensive.

Any help would be appreciated!

Fedreico.

6 responses

Are you sure, since the SMA of RSP never reaches 75

Hi Xin,
By 75 I meant 75-Day Simple Moving Average. Not 75 as a price level.
When ETF RSP price crosses above its 75-day SMA buy the ETF PDP
When ETF RSP price goes below 75 day SMA sell PDP and go tocash.

Haha, silly mistake

Here we go, hope this time i am right

Hi Xin,
Thanks for the coding. I have some doubts:
1- Why the performance in 2008 is negative ? According to the strategy they should be in cash from Jul 2008 and entering a long position in April 2009.
2- Which is the benckmark?
3- Let me explain the strategy again just in case of a small misunderstanding:

If price of ETF RSP is above 75-day SMA go LONG the ETF PDP. Just use the ETF RSP as a reference only on when to buy PDP.
If price of ETF RSP price goes below 75-day SMA sell PDP and go to cash. Be in cash all the time RSP price is below its 75-day SMA line.

In other words, when RSP trades above its 75 day SMA go long PDP and sell PDP going to cash when RSP trades below its 75-day SMA.

Is this what you understood ?
Thanks again!

I think my understand is right. And you can see a flat line between 2008 Jun, and 2008 Sep, And after that there are several crosses actually.

And I have no idea of how they build benchmark here, it is built automatically.

Thanks so much Xin