GithubHelp home page GithubHelp logo

menesesghz / go-minitrader Goto Github PK

View Code? Open in Web Editor NEW
18.0 4.0 3.0 88 KB

A forex bot using GPT3 trading strategies ! built with Golang

License: BSD 2-Clause "Simplified" License

Go 100.00%
gpt-3 trading trading-bot forex capital-com

go-minitrader's Introduction

GPT3 Forex Trader Bot

Version Go

This bot is a forex trading solution that uses strategies generated by GPT3 to trade the markets. It currently utilizes Capital.com as its main broker. The bot is built with Golang, utilizing a concurrent implementation to maximize efficiency.

Example Usage

package main

import (
	"log"
	"os"

	gominitrader "github.com/menesesghz/go-minitrader"
)

func main() {
	capitalClient, err := gominitrader.NewCapitalClient("[email protected]", "<API_TOKEN>", "<API_TOKEN_PASSWORD>", true)
	if err != nil {
		log.Fatal(err)
	}

	// Trade the USD/JPY currency pair with a 2% stop loss and a 0.35% upperbound profit target using 15-minute intervals and the GPTStrategy.
	minitraderUSDJPY := gominitrader.NewMinitrader(
		"USDJPY", 25, 2, 0.35, gominitrader.MINUTE_15, gominitrader.GPTStrategy,
	)

	// Trade the USD/CAD currency pair with a 2% stop loss and a 0.35% upperbound profit target using 15-minute intervals and the GPTStrategy.
	minitraderUSDCAD := gominitrader.NewMinitrader(
		"USDCAD", 25, 2, 0.35, gominitrader.MINUTE_15, gominitrader.GPTShortTermStrategy,
	)

	// Trade the USD/MXN currency pair with a 2% stop loss and a 0.35% upperbound profit target using 15-minute intervals and the GPTShortTermStrategy.
	minitraderUSDMXN := gominitrader.NewMinitrader(
		"USDMXN", 50, 2, 0.35, gominitrader.MINUTE_15, gominitrader.GPTShortTermStrategy,
	)

	minitraderPool, _ := gominitrader.NewMinitraderPool(capitalClient, minitraderUSDJPY, minitraderUSDCAD, minitraderUSDMXN)
	minitraderPool.Start()
}

The previous code is a main Go program that trades forex using the go-minitrader package. It establishes a new client connection to Capital.com, which serves as the designated broker for the bot's trades.

Then, it sets up three different instances of the minitrader for the currency pairs USD/JPY, USD/CAD, and USD/MXN with the same stop loss (2%) and upperbound profit target (0.35%), but with different trade sizes (25 for USD/JPY, 50 for USD/MXN, and default of 25 for USD/CAD) and different strategies (GPTStrategy for USD/JPY, GPTShortTermStrategy for USD/CAD and USD/MXN).

Finally, the program creates a new pool of minitraders, adds the three instances to it and starts the trading process by calling the Start() method.

Features To Be Implemented

  1. Backtesting Engine: The aim of this feature is to develop a backtesting engine that would allow testing the performance of the trading strategies before applying them on real trades.

  2. Telegram Bot Integration: This feature aims to integrate the trading bot with the Telegram Bot API to allow for easy monitoring and control of trades.

  3. Pull Historical Data from Trading View: To improve the performance of the trading strategies, it is necessary to access a larger data set. This feature aims to pull historical data from Trading View, which has a higher data limit compared to Capital.com API's limit of 10 requests per second.

Note

It is important to underline that this is a alpha version, all the strategies haven't been backtested. Only trade with funds that you can afford to lose. This bot is provided as-is and no guarantees or warranties are made regarding its performance. Use at your own risk.

go-minitrader's People

Contributors

menesesghz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

go-minitrader's Issues

Capital Demo Account

Hi,

Your repo looks great! thanks for putting it together, i was wondering if it would be possible to get the trader to run on the capital demo api for testing before using actual money?

Cheers
Kez

Edit* can see you just run it in debug mode for the demo API πŸ‘πŸΎπŸ‘πŸΎ

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.