Files
MycLib/Src/Myc.Trade.Types.pas
T
2025-07-15 01:56:44 +02:00

48 lines
1009 B
ObjectPascal

unit Myc.Trade.Types;
interface
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;
TConstFunc<S, T> = reference to function(const Value: S): T;
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;
end.