QuantConnect / Documentation

QuantConnect Wiki Style Documentation Behind QuantConnect
https://www.quantconnect.com/docs/v2/
Apache License 2.0
171 stars 135 forks source link

Algorithm's Setting: Custom `TradingDaysPerYear` property #1579

Closed Romazes closed 4 months ago

Romazes commented 8 months ago

Expected Behavior

Currently, the TradingDaysPerYear parameter can be set in the algorithm settings. If the user does not set it explicitly, it is expected to be automatically configured based on either the BrokerageModel or default to 252.

For instance:
public override void Initialize()
{
  Settings.TradingDaysPerYear = 200;
}

Also, It will be depending from BrokerageModel:

Actual Behavior

Use hardcoded value TradingDaysPerYear = 252 for both Cryptocurrency Exchanges and Traditional Stock Exchanges. Unfortunately, Cryptocurrency Exchanges should use 365 days. It ruins to calculate right statistics of Algorithm.

Related Issue and PR

Checklist

AlexCatarino commented 4 months ago

Closed by 967f671