Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Algo to return probability of trade success

Hi there,

I am diving into algo trading with Quantopian as a means to teach me python and was curious if anyone has built an algo that does not do the trading but rather returns the probability of a trade success based on the algo ruleset and in turn provides a entry/exit price & success probability based on previous signals that the algo has received from the backtest?

Here is a bit more of a detailed idea I had in mind.

Example rule set for 200 day moving average:

  • IF price breaks above 200 day moving average
    • BUY signal
  • IF price breaks below 200 day moving average
    • SELL signal

So with that rule set, we can backtest over the course of time for an individual stock(eg MSFT), and instead of triggering an actual buy/sell signals to the exchange, we just return the signal to console with:
"BUY @ $X.XX price - X% probability of success" or "SELL @ $X.XX price - X% probability of success".

The algo would have to take in each trade signal it receives in the backtest, somehow figure out where the entry/exit price should be and a % value of the probability of the trade success.

Has anyone done something like this? If so, can you provide examples?
Would love to read over their code to see how they've done it!

Thanks!