unit Myc.Trade.Types;

interface

uses
    Myc.Core.Future;

type
    TTimeframe = (S, S5, S15, S30, M, M2, M3, M5, M10, M15, M30, H, H2, H3, H4, H8, H12, D, D2, D3, W, MN, MN3, MN6, Y);

    // A data record for an Ask/Bid price pair.
    TAskBidItem = packed record
        Ask: Double;
        Bid: Double;
        constructor Create(AAsk, ABid: Double);
    end;

    TOhlcItem = record
        Open: Double;
        High: Double;
        Low: Double;
        Close: Double;
        Volume: Double;
        constructor Create(AOpen, AHigh, ALow, AClose, AVolume: Double);
    end;

    // Represents a time-stamped data point in a series.
    TDataPoint<T> = record
        Time: TDateTime;
        Data: T;
        constructor Create(ATime: TDateTime; const AData: T);
    end;

implementation

{ TAskBidItem }

constructor TAskBidItem.Create(AAsk, ABid: Double);
begin
    Ask := AAsk;
    Bid := ABid;
end;

{ TOhlcItem }

constructor TOhlcItem.Create(AOpen, AHigh, ALow, AClose, AVolume: Double);
begin
    Open := AOpen;
    High := AHigh;
    Low := ALow;
    Close := AClose;
    Volume := AVolume;
end;

{ TDataPoint<T> }

constructor TDataPoint<T>.Create(ATime: TDateTime; const AData: T);
begin
    Time := ATime;
    Data := AData;
end;

end.
