Skip to main content
Glama
test_basic.py909 B
import sys import os sys.path.append(os.getcwd()) from tools.market_data import get_price from tools.execution import place_order, get_positions from tools.risk_engine import portfolio_risk from tools.backtesting import run_backtest def test_tools(): print("Testing Market Data...") # AAPL price (should work if internet is up, otherwise might fail gracefully) try: price = get_price("AAPL", period="1d") print(f"Price Data Length: {len(price)}") except Exception as e: print(f"Market Data failed (expected if no internet): {e}") print("Testing Execution...") print(place_order("AAPL", "buy", 10)) print(get_positions()) print("Testing Risk Engine...") print(portfolio_risk()) print("Testing Backtest...") # Short backtest print(run_backtest("AAPL", 10, 20, "2023-01-01", "2023-02-01")) if __name__ == "__main__": test_tools()

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/N-lia/MonteWalk'

If you have feedback or need assistance with the MCP directory API, please join our Discord server