Skip to content

Zaroganos/goldflipper

Repository files navigation

Goldflipper

Goldflipper Classic Trading System

goldlfipper

Disclaimer

Goldflipper Classic is proprietary, source-available software. Please note that technical support, bug fix, and feature requests are managed on a discretionary basis at this time. This program does not capture or transmit any of your data. Goldflipper only makes connections to brokerage(s) and market data provider(s). Newer branches also make calls using ancillary python libraries in order to enhance function by validating inputs (to address user entry errors), and by checking the market calendar. Security wise, note that in this version, access keys are stored in the settings file in plaintext (or, plain-yaml).

Introduction

Goldflipper Classic is a rules-based semi-autonomous trading system developed in Python. It utilizes a modular, event-driven architecture to automate trading strategy execution, with a current focus on level 2 options trading. The system is designed for customizability, modularity, and offers a feature-rich parameter selection that enables functionality not seen in any other program of its kind. Goldflipper integrates with the Alpaca Markets API for live trading, and has API integrations with market data providers as well in order to provide a modular and robust trading experience with fallbacks for reliability.

Getting Started

Prerequisites

Before you start, ensure you have the following:

  • Alpaca Markets account for brokerage access; multi-broker support is planned with v2
  • Windows OS (required for service functionality and batch files); multi-OS support is planned with v2
  • Git (required for cloning the repository and keeping it up to date)
  • Python 3.10 or higher (Python 3.12 recommended)
  • Python libraries (see Installation section); strongly recommended to use a virtual environment to avoid dependency conflicts. Consider using venv, Poetry, or uv as well (directions to be added in time)
  • Market Data Provider account(s) (required if not using market data from brokerage):
    • Yahoo Finance (free, built-in support via yfinance)

Installation

One Command Bootstrap (Simple)

The easiest way to install Goldflipper is to run the following command in PowerShell:

iwr -useb https://raw.githubusercontent.com/Zaroganos/goldflipper/main/bootstrap.ps1 | iex

The bootstrap script will:

  • Check for and install Git and Python if needed
  • Clone/update the repository to %USERPROFILE%\goldflipper
  • Create a virtual environment
  • Install all dependencies in development mode
  • Launch Goldflipper automatically

Manual Installation

  1. Clone the repository:
git clone https://github.com/Zaroganos/goldflipper.git
cd goldflipper
  1. Install Python dependencies:
pip install -r requirements.txt

Note: You can also install in development mode using setup.py via:

pip install -e . --pre
  1. Initial Setup and Configuration:
    • Run the system once by executing launch_goldflipper.bat
    • This creates goldflipper/config/settings.yaml from the template, or you may upload your existing configuration file of choice.
    • A desktop shortcut is created if desired.
    • Edit settings.yaml with your API keys and preferences:
      • Alpaca API Keys: Get from Alpaca Markets
      • Market Data Provider API Keys: Get from your choice of supported providers. (Currently limited to MarketDataApp)
      • Trading parameters: Set your desired values for risk management, trading behavior, etc.
      • System preferences: Logging levels, watchdog settings, etc.

Running the Trading System

Goldflipper offers multiple interfaces and execution modes:

1. Text Interface (Recommended)

The Text User Interface provides an intuitive way to interact with all system features:

  • (Recommended) Double-click the Goldflipper desktop shortcut, or:
python goldflipper\goldflipper_tui.py

2. Windows Service Mode

  • Runs on startup as daemon

Key Features

🎯 Trading System

  • Semi-autonomous options trading with rules-based execution
  • Advanced play management with state-based workflow
  • Multiple order types: Market, limit at bid/ask/mid/last, contingency orders
  • Risk management: Take profit, stop loss, and contingency stop loss orders
  • Real-time monitoring with continuous play evaluation

πŸ“Š Market Data & Analysis

  • Multiple data providers behind unified manager with automatic failover
  • Options Greeks calculations: Delta, Gamma, Theta, Vega, Rho, and 15+ advanced Greeks
  • Technical indicators: basic views of EMA, MACD, TTM Squeeze, and custom indicators
  • Interactive charting basic candlestick charts and overlay indicators

πŸ–₯️ User Experience

  • Text User Interface built with Textual framework
  • Console mode for direct system interaction
  • Trade logger for analytics
  • Windows service integration for background operation

πŸ”§ Management Tools

  • Play creation tool with guided setup and validation
  • Play editing system with safety protections for active trades
  • Auto play creator for automated bulk play generation
  • System status monitoring with health checks
  • Configuration management with YAML-based settings
  • Data export capabilities (CSV, Excel) for records and analysis

πŸ›‘οΈ System Reliability

  • Watchdog system for automated health monitoring
  • Comprehensive logging with structured trade tracking
  • State persistence with automatic backup and recovery
  • Error handling with graceful degradation and retry logic
  • Market hours validation and holiday awareness

Market Data Providers

Goldflipper supports multiple market data providers for robust and reliable data access:

MarketDataApp (Primary)

Alpaca Markets (Backup)

Yahoo Finance (Backup)

Configuration Guide

Basic Configuration

The system uses a YAML configuration file (goldflipper/config/settings.yaml) with the following key sections:

# Alpaca API Configuration
alpaca:
  accounts:
    paper_1:
      enabled: true
      api_key: 'YOUR_PAPER_API_KEY'
      secret_key: 'YOUR_PAPER_SECRET_KEY'
      base_url: 'https://paper-api.alpaca.markets/v2'
  default_account: 'paper_1'

# Market Data Providers
market_data_providers:
  providers:
    marketdataapp:
      enabled: true
      api_key: 'YOUR_MARKETDATAAPP_KEY'

More Settings

  • Trading parameters: Risk management, position sizing
  • Market hours: Custom trading session definitions
  • Logging levels: Debug, info, warning, error
  • Display options: Chart settings, option chain columns
  • File paths: Custom directory structures

Directory Structure

Goldflipper Classic is roughly organized into the following directory structure: (Simplified for brevity, access the codebase to discover the full content.)

goldflipper/
β”œβ”€β”€ config/                     # Configuration files and settings
β”‚   β”œβ”€β”€ config.py              # Configuration management
β”‚   └── settings_template.yaml # Configuration template
β”œβ”€β”€ data/                      # Data handling modules
β”‚   β”œβ”€β”€ greeks/               # Options Greeks calculations
β”‚   β”œβ”€β”€ indicators/           # Technical indicators
β”‚   β”œβ”€β”€ market/               # Market data handling and management
β”‚   β”‚   β”œβ”€β”€ manager.py        # Market data coordination
β”‚   β”‚   β”œβ”€β”€ operations.py     # Business logic operations
β”‚   β”‚   β”œβ”€β”€ cache.py          # Data caching system
β”‚   β”‚   └── providers/        # Market data provider integrations
β”‚   └── ta/                   # Technical analysis tools
β”œβ”€β”€ chart/                     # Charting and visualization
β”œβ”€β”€ trade_logging/             # Comprehensive logging system
β”‚   β”œβ”€β”€ trade_logger.py       # Core trade logging functionality
β”‚   β”œβ”€β”€ trade_logger_ui.py    # Trade logger user interface
β”‚   └── logs/                 # Application logs storage
β”œβ”€β”€ plays/                     # Trading plays management (state-based), pre-DB
β”‚   β”œβ”€β”€ closed/               # Completed trading positions
β”‚   β”œβ”€β”€ expired/              # Expired options
β”‚   β”œβ”€β”€ new/                  # New trading opportunities
β”‚   β”œβ”€β”€ open/                 # Currently active positions
β”‚   β”œβ”€β”€ pending-closing/      # Positions pending closure
β”‚   β”œβ”€β”€ pending-opening/      # Positions pending opening
β”‚   β”œβ”€β”€ old/                  # Archived plays
β”‚   └── temp/                 # Temporary/OSO plays
β”œβ”€β”€ tools/                     # User-accessible toolkit
β”‚   β”œβ”€β”€ auto_play_creator.py  # Automated play generation (for testing purposes)
β”‚   β”œβ”€β”€ play_creation_tool.py # Interactive play creation
β”‚   β”œβ”€β”€ play-edit-tool.py     # Advanced play editing with safety features
β”‚   β”œβ”€β”€ view_plays.py         # Play viewing and management
β”‚   β”œβ”€β”€ option_data_fetcher.py # Options data retrieval
β”‚   β”œβ”€β”€ get_alpaca_info.py    # Alpaca account information
β”‚   β”œβ”€β”€ system_status.py      # System health monitoring
β”‚   β”œβ”€β”€ configuration.py      # Configuration management
β”‚   └── [multiple other tools] # JSON processing, CSV ingestion, etc.
β”œβ”€β”€ utils/                     # General utility functions
β”œβ”€β”€ watchdog/                  # System monitoring and health checks
β”œβ”€β”€ state/                     # System state management and persistence
β”œβ”€β”€ strategy/                  # Trading strategy definitions
β”œβ”€β”€ reference/                 # Reference materials and templates
β”œβ”€β”€ src/                       # Windows Service code
β”‚   β”œβ”€β”€ service/              # Windows service integration
β”‚   └── state/                # State management components
└── tests/                     # Test suites and validations

License

Copyright (c) 2024-2025 Iliya Yaroshevskiy. All Rights Reserved.

About

Resources

License

Stars

Watchers

Forks

Packages

No packages published