Loading...
Professional development environment for creating custom autonomous trading agents. Build, test, and deploy sophisticated strategies with advanced tooling.
Full-featured IDE with syntax highlighting and auto-completion
Test strategies against historical data with realistic market conditions
Advanced debugging tools for strategy development
Built-in Git support for strategy version management
Professional code editor with all the features you need for agent development:
from c0gni import Agent, Strategy, MarketData
from c0gni.indicators import RSI, MACD
import numpy as np
class AdvancedSniperStrategy(Strategy):
def __init__(self):
super().__init__()
self.rsi = RSI(period=14)
self.macd = MACD(fast=12, slow=26, signal=9)
self.min_liquidity = 10 # ETH
self.confidence_threshold = 0.8
async def on_new_token(self, token_data):
# Multi-factor analysis for new token launches
liquidity_score = self.analyze_liquidity(token_data)
technical_score = await self.technical_analysis(token_data)
sentiment_score = await self.sentiment_analysis(token_data)
# Weighted confidence calculation
confidence = (
liquidity_score * 0.4 +
technical_score * 0.3 +
sentiment_score * 0.3
)
if confidence > self.confidence_threshold:
position_size = self.kelly_criterion(confidence)
return self.buy_signal(
token=token_data.address,
amount=position_size,
confidence=confidence
)
return None
def analyze_liquidity(self, token_data):
if token_data.liquidity < self.min_liquidity:
return 0.0
# Liquidity depth analysis
bid_ask_spread = token_data.ask_price - token_data.bid_price
spread_ratio = bid_ask_spread / token_data.mid_price
return max(0, 1 - (spread_ratio * 10))
async def technical_analysis(self, token_data):
# Get price history for technical indicators
history = await self.get_price_history(token_data.address, periods=100)
if len(history) < 50:
return 0.5 # Neutral for insufficient data
# RSI analysis
rsi_value = self.rsi.calculate(history.close)
rsi_score = 1 - abs(rsi_value - 50) / 50 # Closer to 50 is better
# MACD analysis
macd_line, signal_line, histogram = self.macd.calculate(history.close)
macd_score = 1 if macd_line[-1] > signal_line[-1] else 0
return (rsi_score + macd_score) / 2
Access the professional development environment