Coder Social home page Coder Social logo

strategy-tester-sma-crossover's Introduction

Strategy Tester

A python script that tests a common trading strategy utilizing Simple Moving Averages (SMA) and evaluates the efficiency simulating possible behaviours on a given dataset of a stock/currency.

SMA Crossover Strategy

A common trading strategy utilizing SMAs is to trade based on the position of a shorter-term SMA in relation to a longer-term SMA. For example, traders are bullish when the 20 SMA crosses above the 100 SMA and remains above the 100 SMA, and only turn bearish if the 20 SMA falls below the 100 SMA.
Simple Moving Average
The bot enters the trade (using all the available balance) when 20 SMA line crosses the 100 SMA line from below and exits when they cross again.

Demo

$ python3 chart.py 
Trades Executed 62
Wins: 23 
Losses: 39
Start Balance 1000 
End Balance 1329.4938854299999
Total Profit 329.49388542999986
%ROI Info:
Minimum -2.9139345358678126
Maximum 10.527194143813379
Mean 0.4946017857853304
Median -0.5077724434231157



strategy-tester-sma-crossover's People

Contributors

khanxbahria 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.