FinceptTerminal is a modern finance application offering advanced market analytics, investment research, and economic data tools, designed for interactive exploration and data-driven decision-making in a user-friendly environment.
C++ ai-agentsalgorithmic-tradingbloomberg-terminalcppfinancefinancial-marketsfintechgood-first-issueinvestmentinvestment-researchmachine-learningopensourcepythonqtquantitative-financestock-markettrading
#pragma once
#include "algo_engine/fno/FnoAlgoTypes.h"
#include "services/options/OptionChainTypes.h"
#include <QString>
#include <QVector>
namespace fincept::algo::fno {
// A leg rule resolved to a concrete contract against an OptionChain snapshot.
struct ResolvedLeg {
QString kind; // "CE" | "PE"
QString side; // "BUY" | "SELL"
int lots = 1;
double strike = 0;
qint64 token = 0;
QString symbol; // broker-native symbol taken from the chain row
bool valid = false;
QString error; // reason resolution failed (when !valid)
};
// Pure resolver: leg rules + an OptionChain snapshot -> concrete contracts.
// No I/O, no globals. FUT legs are out of scope here (they resolve from the
// futures instrument, not the option chain) and return valid=false.
class FnoLegResolver {
public:
static ResolvedLeg resolve_one(const AlgoFnoLeg& leg, const fincept::services::options::OptionChain& chain);
static QVector<ResolvedLeg> resolve(const QVector<AlgoFnoLeg>& legs,
const fincept::services::options::OptionChain& chain);
};
} // namespace fincept::algo::fno