Initial commit: Touch & Turn Scalping Bot with fully automated execution, backtesting, and ISA screening

This commit is contained in:
pie
2026-04-22 21:19:33 +01:00
commit dc111abf8c
15 changed files with 1518 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
import os
import logging
from dotenv import load_dotenv
from src.api.client import Trading212Client
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
def test_connection():
load_dotenv()
api_key_id = os.getenv("TRADING212_API_KEY_ID")
api_key = os.getenv("TRADING212_API_KEY")
base_url = os.getenv("TRADING212_BASE_URL", "https://demo.trading212.com/api/v0/")
if not api_key_id or not api_key:
logger.error("API Key ID or API Key is missing in .env")
return
client = Trading212Client(api_key_id, api_key, base_url)
try:
logger.info(f"Connecting to Trading212 at {base_url}...")
account_info = client.get_account_info()
logger.info("Successfully connected!")
logger.info(f"Account Info: {account_info}")
except Exception as e:
logger.error(f"Connection failed: {e}")
if __name__ == "__main__":
test_connection()