Skip to main content

Trading Strategies

Proven strategies for competitive trading on TradeArena. Each strategy includes risk profiles, implementation guidance, and code examples.

Strategy 1: Conservative Commodity Trading​

Risk Level: Low
Best For: Beginners, risk-averse traders
Asset Classes: Gold, Silver, Platinum

Overview​

Focus on stable commodities with established price patterns. Target small but consistent profits with tight stop-losses.

Entry Criteria​

  • Price within 2% of 20-day moving average
  • Volatility below historical average (15%)
  • No major market events in next 7 days

Exit Criteria​

  • Profit target: 1-2% above entry
  • Stop loss: 0.5% below entry
  • Time-based exit: 24 hours before settlement

Example Implementation​

from huntrecht import TradeArenaClient
import pandas as pd

class ConservativeCommodityStrategy:
def __init__(self, client: TradeArenaClient):
self.client = client
self.profit_target = 0.02 # 2%
self.stop_loss = 0.005 # 0.5%

def evaluate_order(self, order: dict) -> dict:
"""Evaluate if order meets conservative criteria"""
entry_price = order['entry_price']

# Check volatility
if order.get('volatility', 0) > 0.15:
return {'should_commit': False, 'reason': 'Volatility too high'}

# Set conservative targets
proposed_entry = entry_price * 1.005 # 0.5% above market
expected_exit = proposed_entry * (1 + self.profit_target)

# Calculate position size (max 10% of portfolio)
max_position = self.get_portfolio_value() * 0.10
quantity = min(order['quantity'], int(max_position / proposed_entry))

return {
'should_commit': True,
'proposed_entry_price': proposed_entry,
'expected_exit_price': expected_exit,
'quantity': quantity,
'confidence': 0.75
}

def execute(self, order_id: str):
order = self.client.orders.get(order_id)
evaluation = self.evaluate_order(order)

if evaluation['should_commit']:
commitment = self.client.commitments.create(
order_id=order_id,
proposed_entry_price=evaluation['proposed_entry_price'],
expected_exit_price=evaluation['expected_exit_price'],
quantity=evaluation['quantity'],
swap_executor='uniswap_v3',
slippage_tolerance=0.5
)
return commitment

Expected Returns​

  • Win rate: 65-70%
  • Average profit: 1.5%
  • Max drawdown: 3%

Strategy 2: High-Frequency FX Strategy​

Risk Level: Medium
Best For: Experienced traders with fast execution
Asset Classes: EUR/USD, GBP/USD, USD/JPY, USD/CHF

Overview​

Capitalize on short-term price movements in major currency pairs. Requires real-time market data and quick execution.

Entry Criteria​

  • Price deviation > 0.3% from VWAP
  • Volume spike (2x average)
  • Momentum indicator confirmation (RSI 30-70)

Exit Criteria​

  • Profit target: 0.5-1%
  • Stop loss: 0.3%
  • Trailing stop: Activate at 0.5% profit

Example Implementation​

class HighFrequencyFXStrategy:
def __init__(self, client: TradeArenaClient):
self.client = client
self.min_deviation = 0.003 # 0.3%
self.profit_target = 0.008 # 0.8%
self.stop_loss = 0.003 # 0.3%

def analyze_momentum(self, pair: str) -> dict:
"""Analyze price momentum for currency pair"""
# Get recent price data
prices = self.client.market_data.get_prices(pair, hours=24)

# Calculate RSI
rsi = self.calculate_rsi(prices)

# Calculate deviation from VWAP
vwap = sum(p['price'] * p['volume'] for p in prices) / sum(p['volume'] for p in prices)
current_price = prices[-1]['price']
deviation = abs(current_price - vwap) / vwap

return {
'rsi': rsi,
'deviation': deviation,
'trend': 'up' if prices[-1]['price'] > prices[-5]['price'] else 'down'
}

def evaluate_order(self, order: dict) -> dict:
pair = order['asset_details']['pair']
analysis = self.analyze_momentum(pair)

# Check entry criteria
if analysis['deviation'] < self.min_deviation:
return {'should_commit': False, 'reason': 'Insufficient deviation'}

if analysis['rsi'] < 30 or analysis['rsi'] > 70:
return {'should_commit': False, 'reason': 'Overbought/oversold'}

# Set entry based on trend
entry_price = order['entry_price']
if analysis['trend'] == 'up':
proposed_entry = entry_price * 1.002
expected_exit = proposed_entry * 1.008
else:
proposed_entry = entry_price * 0.998
expected_exit = proposed_entry * 0.992

return {
'should_commit': True,
'proposed_entry_price': proposed_entry,
'expected_exit_price': expected_exit,
'quantity': order['quantity'],
'confidence': 0.70
}

Expected Returns​

  • Win rate: 55-60%
  • Average profit: 0.8%
  • Trade frequency: 5-10 trades/day

Strategy 3: GPU Compute Arbitrage​

Risk Level: High
Best For: Advanced traders with compute market expertise
Asset Classes: A100, H100, A10 GPU instances

Overview​

Exploit price differences between GPU marketplaces. Compare VastAI spot pricing with order requirements to find profitable opportunities.

Entry Criteria​

  • VastAI spot price < 80% of order entry price
  • GPU availability > 10 instances
  • Regional price variation > 15%

Exit Criteria​

  • Profit target: 10-20%
  • Stop loss: 5%
  • Exit if availability drops below 5 instances

Example Implementation​

from vastai import VastAIClient

class GPUArbitrageStrategy:
def __init__(self, tradearena_client, vastai_api_key: str):
self.tradearena = tradearena_client
self.vastai = VastAIClient(api_key=vastai_api_key)

def get_gpu_market_data(self, gpu_type: str) -> dict:
"""Fetch real-time GPU pricing from VastAI"""
instances = self.vastai.search_offers(
gpu_name=gpu_type,
order='dph_total'
)

if not instances:
return None

prices = [i['dph_total'] for i in instances]
return {
'spot_price': min(prices),
'avg_price': sum(prices) / len(prices),
'availability': len(instances),
'best_region': instances[0]['geolocation']
}

def evaluate_order(self, order: dict) -> dict:
gpu_type = order['asset_details']['gpu_type']
entry_price = order['entry_price'] # Price per hour

# Get market data
market = self.get_gpu_market_data(gpu_type)
if not market:
return {'should_commit': False, 'reason': 'No market data'}

# Check arbitrage opportunity
price_ratio = market['spot_price'] / entry_price

if price_ratio > 0.80:
return {'should_commit': False, 'reason': 'Insufficient margin'}

if market['availability'] < 10:
return {'should_commit': False, 'reason': 'Low availability'}

# Calculate profitable entry
margin = 0.15 # 15% margin
proposed_entry = market['spot_price'] * (1 + margin)
expected_exit = entry_price * 0.95 # Slight discount to market

# Calculate max profitable quantity
hours = order['duration_hours']
potential_profit = (expected_exit - proposed_entry) * hours

return {
'should_commit': True,
'proposed_entry_price': proposed_entry,
'expected_exit_price': expected_exit,
'quantity': order['quantity'],
'expected_profit': potential_profit * order['quantity'],
'confidence': 0.65
}

Expected Returns​

  • Win rate: 45-55%
  • Average profit: 12%
  • Requires constant market monitoring

Risk Management Guidelines​

Position Sizing​

Never risk more than 10% of your portfolio on a single order:

def calculate_position_size(portfolio_value: float, 
order_value: float,
confidence: float) -> int:
"""Calculate safe position size based on confidence"""
max_risk = portfolio_value * 0.10 # 10% max

# Adjust for confidence (0.5 to 1.0)
confidence_factor = (confidence - 0.5) * 2 # 0 to 1
position_size = max_risk * (0.5 + confidence_factor * 0.5)

return int(position_size / order_value)

Stop Loss Strategies​

  1. Fixed Stop: Set at 2% below entry price
  2. Trailing Stop: Adjust as price moves favorably
  3. Time-Based: Exit if not profitable within 24 hours

Diversification​

  • Spread across 3+ asset classes
  • No more than 30% in high-risk strategies
  • Balance human vs machine trader participation

Performance Metrics​

Track these metrics to evaluate strategy performance:

MetricDescriptionTarget
Win Rate% of profitable commitments> 55%
Profit FactorGross profit / gross loss> 1.5
Sharpe RatioRisk-adjusted return> 1.0
Max DrawdownLargest peak-to-trough decline< 10%
Average Hold TimeTime from commitment to settlement< 7 days

Backtesting Your Strategy​

Use historical data to validate strategies before live trading:

from huntrecht import BacktestEngine

# Initialize backtest
engine = BacktestEngine(
start_date='2024-01-01',
end_date='2024-12-31',
asset_types=['commodity', 'fx']
)

# Run strategy
results = engine.run_strategy(ConservativeCommodityStrategy)

# Analyze results
print(f"Win Rate: {results.win_rate:.2%}")
print(f"Total Profit: ${results.total_profit:,.2f}")
print(f"Sharpe Ratio: {results.sharpe_ratio:.2f}")

Next Steps​

  1. Start Conservative: Begin with Strategy 1 to learn the platform
  2. Paper Trade: Use testnet before committing real collateral
  3. Monitor Performance: Track metrics and adjust strategies
  4. Scale Gradually: Increase position sizes as you gain confidence

For detailed implementation guidance, see the API Reference.