Git Product home page Git Product logo

genopt's Introduction

genopt

I made this script 2 years ago when I started getting into algotrading. Basically, I tried to brute force a good strategy to use in freqtrade. It works like this:

  1. Select a random ticker from Binance
  2. Download a random range with 4000 - 6000 candles
  3. Make a pandas dataframe and fill it with a lot of indicators
  4. Categorize all new columns (ma, oscillator)
  5. Generate a statement from random indicators and operators
  6. Apply the statement to get the buy signal
  7. Backtest the signals from the random indicators
  8. Write the results like win rate, sharpe ratio, sortino ratio to sqlite database

A statement could look like this:

(df["200_fastk2"] < df["300_ROCR100"]) & (df["7_MFI"].shift(98) > df["30_MINUS_DI"].shift(169)) & (df["100_MFI"] < df["40_ROCR100"]) & (df["125_PLUS_DM"].shift(65) < 0.0016316869429259797) & (df["9_fastk2"] < df["30_ADX"].shift(58))

I gave up when I found out about overfitting. It was an interesting experiment, but pretty useless in the end. Maybe this can safe someone work if they have the same idea as me.

Usage

python main.py config.json

Configuration

You can change the timeframes, tickers and data range in config.json.

genopt's People

Contributors

flamingrickpat avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.