PromptBase
Close icon
General
Home
Marketplace
Hire
Create
Login
Sell
Explore
🤖 GPT

Stockcrypto Trading Bot Builder

Stockcrypto Trading Bot Builder gpt prompt mini thumbnail
4Heart icon
Favorites
227Eye icon
Views
GPT-3.5-TURBO
TestedTick icon
TipsTick icon
(Prompt at discount for a limited time till July) This prompt construct your own unique trading algorithms. This prompt is designed to help users build a trading bot for stocks, cryptocurrencies, or forex. It allows users to specify their preferred coding language, the number of tickers to trade, the ticker symbols and cash allocation, the dollar value or number of shares for each position, and the time intervals for trading. Make it simple or make it complex, you can do it all with this prompt
...more
$6.99
Get prompt
After purchasing, you will gain access to the prompt file which you can use with GPT or the app builder. You'll receive 20 free generation credits with this purchase. By purchasing this prompt, you agree to our terms of service.
Updated: Over 1 month ago

Prompt Details

Model
Chat - GPT-3.5 (gpt-3.5-turbo)
Token size
638 ($0.00130 / call)
Example input
[Code language]: Python, [Bot type]: Forex [Time Frames]: 3min 5min 1hr, [Trading indicator]: RSI VWAP SMA , ect.
Example output
Okay, let's start coding your Forex trading bot in Python based on the given requirements: First, we will import the necessary libraries: python Copy code import pandas as pd import numpy as np import oandapyV20 import oandapyV20.endpoints.trades as trades import oandapyV20.endpoints.orders as orders import oandapyV20.endpoints.pricing as pricing import time Next, we will define some variables: python Copy code tickers = ["GBP_USD", "USD_CAD", "USD_CHF", "USD_JPY"] allocation = [0.25, 0.25, 0.25, 0.25] # Cash allocation for each ticker total_cash = 10000 # Total available cash position_size = 100 # Dollar value for each position opening timeframes = ["M3", "M15", "H1", "H4", "D"] # Time intervals indicators = ["EMA", "RSI", "BBANDS", "ICHIMOKU"] # Indicators to use rsi_buy = 28 # RSI buy signal value rsi_sell = 72 # RSI sell signal value rsi_hold_low = 35 # RSI hold signal low range rsi_hold_high = 65 # RSI hold signal high range tenkan_period = 9 # Ichimoku Cloud Tenkan-sen period kijun_period = 26 # Ichimoku Cloud Kijun-sen period senkou_a_period = 52 # Ichimoku Cloud Senkou Span A period senkou_b_period = 26 # Ichimoku Cloud Senkou Span B period chikou_lag_period = 26 # Ichimoku Cloud Chikou Span lag period trailing_stop = 2 # Trailing stop order percentage We will also define some functions: python Copy code def get_price(ticker): """ Get the current price for a given ticker """ params = {"instruments": ticker} r = pricing.PricingInfo(accountID=account_id, params=params) rv = api.request(r) return float(rv["prices"][0]["bids"][0]["price"]) def get_position_size(price): """ Calculate the position size based on the given price """ return int(position_size / price) def get_rsi(df): """ Calculate the RSI for a given dataframe """ delta = df["close"].diff() gain = delta.where(delta > 0, 0) loss = -delta.where(delta < 0, 0) avg_gain = gain.rolling(14).mean() avg_loss = loss.rolling(14).mean() rs = avg_gain / avg_loss rsi = 100 - (100 / (1 + rs)) return rsi[-1] def get_bbands(df): """ Calculate the Bollinger Bands for a given dataframe """ ma = df["close"].rolling(20).mean() std = df["close"].rolling(20).std() upper_band = ma + 2 * std lower_band = ma - 2 * std return upper_band[-1], lower_band[-1] def get_ichimoku(df): """ Calculate the Ichimoku Cloud for a given dataframe """ high = df["high"] low = df["low"] tenkan_sen_high = high.rolling(tenkan_period).max
Browse Marketplace