Nija

NIJA Institutional-Grade Features

Overview

NIJA now includes institutional-grade compliance features that separate validation, performance tracking, and marketing layers with appropriate disclaimers. This makes NIJA investment-ready and suitable for professional trading operations.

Key Features

1. Explicit Validation Disclaimer

All logs and reports now include the prominent banner:

╔════════════════════════════════════════════════════════════════════════════╗
║                      MATHEMATICAL VALIDATION ONLY                          ║
║          DOES NOT REPRESENT HISTORICAL OR FORWARD PERFORMANCE              ║
╚════════════════════════════════════════════════════════════════════════════╝

This disclaimer automatically appears in:

2. Three-Layer Architecture

NIJA separates concerns into three distinct layers:

Validation Layer (bot/validation_layer.py)

Performance Tracking Layer (bot/performance_tracking_layer.py)

Marketing Layer (bot/marketing_layer.py)

3. Statistical Reporting Module

The Statistical Reporting Module (bot/statistical_reporting_module.py) provides:

Win Rate Over Last 100 Trades

from bot.statistical_reporting_module import get_statistical_reporting_module

module = get_statistical_reporting_module()
stats = module._get_key_statistics()
print(f"Win Rate: {stats['win_rate_last_100_trades']['value']:.2f}%")

Maximum Drawdown

max_dd = stats['max_drawdown']['value']
print(f"Max Drawdown: {max_dd:.2f}%")

Rolling Expectancy

Expected profit per trade over the last 100 trades:

expectancy = stats['rolling_expectancy']['value']
print(f"Expectancy: ${expectancy:.2f} per trade")

Equity Curve

Complete account value progression over time, exportable as CSV.

Usage

Quick Start

from bot.institutional_disclaimers import print_validation_banner
from bot.performance_tracking_layer import get_performance_tracking_layer
from bot.statistical_reporting_module import get_statistical_reporting_module

# Display disclaimer
print_validation_banner()

# Initialize performance tracking
perf = get_performance_tracking_layer()
perf.set_initial_balance(10000.0)

# Record trades
perf.record_trade(
    symbol='BTC-USD',
    strategy='APEX_V71',
    side='buy',
    entry_price=45000,
    exit_price=46000,
    quantity=0.1,
    profit=100,
    fees=2
)

# Get statistics
stats = perf.get_statistics_summary()
print(f"Win Rate: {stats['win_rate_last_100']:.2f}%")
print(f"Max Drawdown: {stats['max_drawdown_pct']:.2f}%")
print(f"Rolling Expectancy: ${stats['rolling_expectancy']:.2f}")

# Generate reports
module = get_statistical_reporting_module()
module.print_summary()
exports = module.export_all_reports()

Integration with Existing Trading Bot

  1. Import the institutional disclaimers: ```python from bot.institutional_disclaimers import get_institutional_logger

logger = get_institutional_logger(name) logger.show_validation_disclaimer()


2. **Record trades in your execution engine:**
```python
from bot.performance_tracking_layer import get_performance_tracking_layer

perf = get_performance_tracking_layer()
perf.set_initial_balance(initial_capital)

# After each trade execution:
perf.record_trade(
    symbol=trade.symbol,
    strategy=trade.strategy,
    side=trade.side,
    entry_price=trade.entry_price,
    exit_price=trade.exit_price,
    quantity=trade.quantity,
    profit=trade.profit,
    fees=trade.fees,
    duration_seconds=trade.duration
)
  1. Generate reports periodically: ```python from bot.marketing_layer import get_marketing_layer

marketing = get_marketing_layer()

Export investor-ready reports

marketing.export_investor_report(format=’json’) marketing.export_investor_report(format=’txt’) marketing.export_equity_curve_csv()


### Validation Workflow

Use the Validation Layer to validate strategies mathematically:

```python
from bot.validation_layer import get_validation_layer

validation = get_validation_layer()

# Validate a strategy using historical data
result = validation.validate_strategy(
    strategy_name="APEX_V71",
    historical_trades=backtest_results,
    validation_period_days=90
)

print(f"Win Rate: {result.win_rate:.2f}%")
print(f"Profit Factor: {result.profit_factor:.2f}")
print(f"Statistical Confidence: {result.statistical_confidence:.1f}%")

Report Generation

Comprehensive Statistical Report

from bot.statistical_reporting_module import get_statistical_reporting_module

module = get_statistical_reporting_module()

# Print summary to console
module.print_summary()

# Export all reports
exports = module.export_all_reports(output_dir='./reports')

This generates:

Command-Line Interface

# Print summary
python bot/statistical_reporting_module.py --summary

# Export all reports
python bot/statistical_reporting_module.py --export

# Custom output directory
python bot/statistical_reporting_module.py --export --output-dir /path/to/reports

Files Created

Startup Integration

The disclaimer banner is automatically displayed when:

  1. Importing the institutional_disclaimers module
  2. Calling display_feature_flag_banner() in startup_diagnostics
  3. Initializing any of the three layers
  4. Generating any reports

Compliance Benefits

Clear Disclaimers - All outputs include appropriate disclaimers ✅ Separation of Concerns - Validation, tracking, and marketing are distinct ✅ Statistical Rigor - Proper metrics with sample size considerations ✅ Investor-Ready - Reports formatted for professional presentation ✅ Risk Transparency - Maximum drawdown and other risk metrics prominently displayed ✅ Performance Tracking - Real-time statistics separate from validation

Best Practices

  1. Always display disclaimers when presenting performance data
  2. Use Validation Layer for strategy testing and optimization
  3. Use Performance Tracking Layer for live trading only
  4. Use Marketing Layer for external communications
  5. Generate reports regularly to maintain audit trail
  6. Export equity curves for visual performance review
  7. Monitor win rate, drawdown, and expectancy continuously

Example Output

╔════════════════════════════════════════════════════════════════════════════╗
║                      MATHEMATICAL VALIDATION ONLY                          ║
║          DOES NOT REPRESENT HISTORICAL OR FORWARD PERFORMANCE              ║
╚════════════════════════════════════════════════════════════════════════════╝

NIJA STATISTICAL REPORTING MODULE
================================================================================

KEY STATISTICS:
--------------------------------------------------------------------------------
Win Rate (Last 100 Trades): 66.67%
  Sample Size: 100 trades

Maximum Drawdown: 5.23%
  Interpretation: Lower is better - indicates downside risk

Rolling Expectancy: $33.45
  Formula: (Win Rate × Avg Win) - (Loss Rate × Avg Loss)

Equity Curve Data Points: 500
  Export: CSV available via marketing layer

================================================================================
Report Generated: 2026-02-15 00:45:00
================================================================================

Next Steps

  1. Integrate into main trading loop
  2. Set up automated report generation
  3. Configure data export schedules
  4. Review and validate statistical outputs
  5. Share reports with stakeholders

Support

For questions or issues related to institutional-grade features, see: