Model Details

Mandatory Time Periods

1 - 501

Optional Time Periods

502 - 10,000

Request Header

Authorization
string
required

The authorization token for API requests. This should be a valid Bearer token.

Request Example

When forecasting future price trends (for Feb 24th), you can use zeros (0) for unknown values:

{
    'Datetime': ["2020-08-03 00:00:00", ..., "2024-09-04 00:00:00"],
    'Open': [194.33, ..., 0],         # Unknown future value
    'High': [197.02, ..., 0],         # Unknown future value
    'Low': [192.87, ..., 0],          # Unknown future value
    'Close': [195.45, ..., 0]         # Unknown future value
}

For risk forecasting, use either the known opening price or the previous day’s closing price, while keeping other future values as zero:

{
    'Datetime': ["2020-08-03 00:00:00", ..., "2024-09-04 00:00:00"],
    'Open': [194.33, ..., 286.55],    # Known opening price or previous close
    'High': [197.02, ..., 0],         # Unknown future value
    'Low': [192.87, ..., 0],          # Unknown future value
    'Close': [195.45, ..., 0]         # Unknown future value
}

Response Fields

datetime
string

Timestamp for forecast

open
number

Opening price for period

current_trend_direction
number
forecasted_trend_direction
number
cumulative_trend_forecast
number

Cumulative price trend forecast for comparison with actual price (Not to Scale)

risk_forecast_%
number

Expected price movement range (%)

risk_forecast
number

Expected price movement range (absolute)

Example - API Request


# Import necessary libraries
import pandas as pd
import requests

# Define function to create json for API 
def ts_model_dict(df):
    # Convert DataFrame to dictionary format
    return {
        "Datetime": df['Datetime'].tolist(),
        "Open": df['Open'].tolist(),
        "High": df['High'].tolist(),
        "Low": df['Low'].tolist(),
        "Close": df['Close'].tolist()
    }

# Import Data
df = pd.read_csv("")[['Datetime','Open','High','Low','Close']]

# Create JSON payload for API request
data = ts_model_dict(df)

# Specify Base URL & Access Token
BASE_URL = ""
TOKEN = ""

# Set API endpoint URL
api_url = f"{BASE_URL}/genesis/ts-model"

# Set header for API request
headers = {"Authorization": f"Bearer {TOKEN}", 'Content-Type': 'application/json'}

# Send POST request to API
response = requests.post(api_url, json=data, headers=headers)

# Parse JSON response
resp = response.json()

Example - API Response


{
  
  "2020-08-03 00:00:00":
    {
      "open":194.33,
      "current_trend":1,
      "price_trend_forecast":1,
      "risk_forecast_%":-0.2,
      "risk_forecast":193.94,
      "cumulative_trend_forecast":1
    },

  "2020-08-04 00:00:00":
    {
      "open":194.95,
      "current_trend":1,
      "price_trend_forecast":0,
      "risk_forecast_%":-0.52,
      "risk_forecast":193.94,
      "cumulative_trend_forecast":1 
    }
  
  ..., 

  "2024-09-03 00:00:00":
    {
      "open":286.35,
      "current_trend":-1,
      "price_trend_forecast":-1,
      "risk_forecast_%":1.1,
      "risk_forecast":289.5,
      "cumulative_trend_forecast":3000
    },

  "2024-09-04 00:00:00":
    {
      "open":286.55,
      "current_trend":-1,
      "price_trend_forecast":-1,
      "risk_forecast_%":0.9,
      "risk_forecast":289.13,
      "cumulative_trend_forecast":2999

    }
    
}