Performance

Aggregate performance metrics and overview statistics.

Performance overview

Retrieve comprehensive performance analytics and statistics for your trading account.

Endpoint: GET /api/v1/performance/overview

Query parameters

ParameterTypeDescription
start_datestringOptional range start (ISO 8601, YYYY-MM-DD)
end_datestringOptional range end (ISO 8601, YYYY-MM-DD)

Example requests

cURL - All time performance:

curl "https://app.mypropjournal.com/api/v1/performance/overview" \
  -H "Authorization: Bearer mpj_your_api_key_here" \
  -H "Content-Type: application/json"

cURL - Custom date range:

curl "https://app.mypropjournal.com/api/v1/performance/overview?start_date=2024-01-01&end_date=2024-03-31" \
  -H "Authorization: Bearer mpj_your_api_key_here" \
  -H "Content-Type: application/json"

JavaScript:

async function getPerformance(startDate, endDate) {
  const params = new URLSearchParams();
  if (startDate) params.append('start_date', startDate);
  if (endDate) params.append('end_date', endDate);
  
  const url = `https://app.mypropjournal.com/api/v1/performance/overview?${params}`;
  
  const response = await fetch(url, {
    headers: {
      'Authorization': 'Bearer mpj_your_api_key_here',
      'Content-Type': 'application/json'
    }
  });
  
  return response.json();
}

// Get Q1 2024 performance
const q1Performance = await getPerformance('2024-01-01', '2024-03-31');
console.log(`Win rate: ${q1Performance.data.win_rate}%`);
console.log(`Profit factor: ${q1Performance.data.profit_factor}`);

Python:

import requests
from datetime import datetime, timedelta

def get_performance(start_date=None, end_date=None):
    url = 'https://app.mypropjournal.com/api/v1/performance/overview'
    headers = {
        'Authorization': 'Bearer mpj_your_api_key_here',
        'Content-Type': 'application/json'
    }
    
    params = {}
    if start_date:
        params['start_date'] = start_date
    if end_date:
        params['end_date'] = end_date
    
    response = requests.get(url, headers=headers, params=params)
    response.raise_for_status()
    return response.json()

# Get last 30 days performance
end_date = datetime.now().strftime('%Y-%m-%d')
start_date = (datetime.now() - timedelta(days=30)).strftime('%Y-%m-%d')

performance = get_performance(start_date, end_date)
print(f"Total P&L: ${performance['data']['total_pnl']:.2f}")
print(f"Win rate: {performance['data']['win_rate']:.2f}%")

Example response

{
  "data": {
    "total_trades": 305,
    "winning_trades": 171,
    "losing_trades": 134,
    "win_rate": 56.07,
    "total_pnl": 17148.96,
    "total_gross_pnl": 18268.23,
    "total_commissions": 1119.02,
    "average_win": 236.9,
    "average_loss": 174.34,
    "profit_factor": 1.36,
    "best_trade": {
      "id": "7dcfb966-dc84-44e5-bdb0-820a2a91ed06",
      "symbol": "NQ",
      "pnl": 7862.88,
      "date": "2024-02-13"
    },
    "worst_trade": {
      "id": "8e1ec452-662d-459f-9747-19c33cbce0df",
      "symbol": "NQ",
      "pnl": -2348.72,
      "date": "2024-02-13"
    }
  }
}

Response fields

FieldTypeDescription
total_tradesintegerTotal number of closed trades
winning_tradesintegerNumber of profitable trades
losing_tradesintegerNumber of losing trades
win_ratenumberPercentage of winning trades (0-100)
total_pnlnumberNet profit/loss after commissions
total_gross_pnlnumberGross profit/loss before commissions
total_commissionsnumberTotal fees paid across all trades
average_winnumberAverage profit per winning trade
average_lossnumberAverage loss per losing trade (positive number)
profit_factornumberRatio of gross profit to gross loss
best_tradeobjectDetails of most profitable trade
worst_tradeobjectDetails of largest losing trade

Using date filters

All-time performance

Omit both parameters to get lifetime statistics:

GET /api/v1/performance/overview

Custom date range

Specify both start_date and end_date for a specific period:

GET /api/v1/performance/overview?start_date=2024-01-01&end_date=2024-12-31

Open-ended ranges

Use one parameter to create open-ended ranges:

# All trades since a specific date
GET /api/v1/performance/overview?start_date=2024-01-01

# All trades up to a specific date
GET /api/v1/performance/overview?end_date=2024-12-31

Common use cases

Monthly performance report

function getMonthPerformance(year, month) {
  const startDate = `${year}-${String(month).padStart(2, '0')}-01`;
  const lastDay = new Date(year, month, 0).getDate();
  const endDate = `${year}-${String(month).padStart(2, '0')}-${lastDay}`;
  
  return getPerformance(startDate, endDate);
}

// Get January 2024 performance
const jan2024 = await getMonthPerformance(2024, 1);

Quarterly comparison

def get_quarterly_performance(year, quarter):
    quarters = {
        1: ('01-01', '03-31'),
        2: ('04-01', '06-30'),
        3: ('07-01', '09-30'),
        4: ('10-01', '12-31')
    }
    
    start_month, start_day = quarters[quarter][0].split('-')
    end_month, end_day = quarters[quarter][1].split('-')
    
    start_date = f"{year}-{start_month}-{start_day}"
    end_date = f"{year}-{end_month}-{end_day}"
    
    return get_performance(start_date, end_date)

# Compare Q1 and Q2 2024
q1 = get_quarterly_performance(2024, 1)
q2 = get_quarterly_performance(2024, 2)

print(f"Q1 Win Rate: {q1['data']['win_rate']:.2f}%")
print(f"Q2 Win Rate: {q2['data']['win_rate']:.2f}%")

Understanding metrics

Win rate

Percentage of trades that were profitable:

Win Rate = (Winning Trades / Total Trades) × 100

Profit factor

Ratio of gross profit to gross loss. Values above 1.0 indicate profitability:

Profit Factor = Total Gross Profit / Total Gross Loss
  • < 1.0: Losing overall
  • 1.0 - 1.5: Marginally profitable
  • 1.5 - 2.0: Good performance
  • > 2.0: Excellent performance

Average win vs. average loss

Compare the size of your winners to your losers. Ideally, average wins should be larger than average losses (positive risk-reward ratio).

Error responses

400 Bad Request

Invalid date format:

{
  "error": "Invalid date format",
  "code": "VALIDATION_ERROR",
  "details": {
    "start_date": "Must be in YYYY-MM-DD format"
  }
}

401 Unauthorized

Missing or invalid API key:

{
  "error": "Invalid API key",
  "code": "INVALID_API_KEY"
}