Using Artificial intelligence to Backtest TSLA

I created a bot that when you enter a stock name, will proceed to backtest that stock using a custom strategy with 2 years of historical stock data. Today I decided to try it out on Tesla (TSLA). Here is a simplified chart of the results.

$Tesla Motors(TSLA)$

Is this good? Not really, this is only a meager 2% gain in 2 years, but it is a good start to how I want my bot to perform. Of course, past performance is not indicative of future results.


Backtesting using a custom program is better due to many reasons, such as:


1. Custom strategies. You can build whatever strategy you want inside, fit it with stop losses and take profits, and boom, it will run and churn out results automatically.

2. Flexibility. You can change buying power, stocks to buy, you can even shove multiple stocks inside at one time and let the program run for a couple minutes, get coffee or go touch some grass, and come back to see the total profits.


It's amazing how you can get years of data in seconds using a simple python script. 

@TigerEvents


# Technical Analysis

Disclaimer: Investing carries risk. This is not financial advice. The above content should not be regarded as an offer, recommendation, or solicitation on acquiring or disposing of any financial products, any associated discussions, comments, or posts by author or other users should not be considered as such either. It is solely for general information purpose only, which does not consider your own investment objectives, financial situations or needs. TTM assumes no responsibility or warranty for the accuracy and completeness of the information, investors should do their own research and may seek professional advice before investing.

Report

Comment

  • Top
  • Latest
  • diggydog
    ·2022-05-03
    Well done. From which source you pull the data?
    Reply
    Report
    Fold Replies
    • diggydogReplying toKinneh
      Cool. I didn't know Tiger has Open API.
      2022-05-03
      Reply
      Report
    • Kinneh

      Either using Tiger's own OpenAPI or other sources like yahoo finance

      2022-05-03
      Reply
      Report
  • highhand
    ·2022-05-03
    for Tesla, the bot is Musk. need to input data into Musk to churn out the results [Happy]
    Reply
    Report
  • Desw
    ·2022-05-25
    [强] [财迷] [强]
    Reply
    Report
  • 点金胜手Max
    ·2022-05-04
    ok
    Reply
    Report
  • _J_R_
    ·2022-05-04
    Nice
    Reply
    Report
  • Magneto
    ·2022-05-03
    Okay.
    Reply
    Report
  • Skyjieni
    ·2022-05-03
    Good
    Reply
    Report
  • Skyjieni
    ·2022-05-03
    Good
    Reply
    Report
  • Prost
    ·2022-05-03
    Nice
    Reply
    Report
  • Skyjieni
    ·2022-05-03
    Yeahhyeah
    Reply
    Report
  • GhordofWar
    ·2022-05-03
    gr8
    Reply
    Report
  • Popo123
    ·2022-05-03
    Nice
    Reply
    Report
  • CL_Wong
    ·2022-05-03
    Ok
    Reply
    Report
  • GhordofWar
    ·2022-05-03
    ok
    Reply
    Report
  • Skyjieni
    ·2022-05-03
    Yeah
    Reply
    Report
  • GhordofWar
    ·2022-05-03
    good
    Reply
    Report
  • GoodLife99
    ·2022-05-03
    great!
    Reply
    Report
  • AshlynnLee
    ·2022-05-03
    [Like]
    Reply
    Report
  • SG58
    ·2022-05-16
    ok
    Reply
    Report