-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/missing_events' into swift
# Conflicts: # DXFeedFramework.xcodeproj/project.pbxproj # DXFeedFramework.xcodeproj/xcshareddata/xcschemes/Tools.xcscheme # DXFeedFramework/Events/Market/TimeAndSale.swift
- Loading branch information
Showing
71 changed files
with
3,099 additions
and
70 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,10 +57,10 @@ | |
</CommandLineArgument> | ||
<CommandLineArgument | ||
argument = "DXFeedIpfConnect Quote https://demo:[email protected]/ipf" | ||
isEnabled = "YES"> | ||
isEnabled = "NO"> | ||
</CommandLineArgument> | ||
<CommandLineArgument | ||
argument = "ScheduleSample /Users/akosylo/test_ipf/schedule.zip /Users/akosylo/test_ipf/sample.ipf.zip AAPL 2012-05-26-14:15:00" | ||
argument = "ScheduleSample schedule.zip sample.ipf.zip AAPL 2012-05-26-14:15:00" | ||
isEnabled = "NO"> | ||
</CommandLineArgument> | ||
<CommandLineArgument | ||
|
@@ -72,8 +72,8 @@ | |
isEnabled = "NO"> | ||
</CommandLineArgument> | ||
<CommandLineArgument | ||
argument = "Connect mddqa.in.devexperts.com:7400 Quote AAPL" | ||
isEnabled = "NO"> | ||
argument = "Connect mddqa.in.devexperts.com:7400 OptionSale AAPL" | ||
isEnabled = "YES"> | ||
</CommandLineArgument> | ||
<CommandLineArgument | ||
argument = "LatencyTest mddqa.in.devexperts.com:7400 TimeAndSale ETH/USD:GDAX" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// | ||
// AnalyticOrder.swift | ||
// DXFeedFramework | ||
// | ||
// Created by Aleksey Kosylo on 11.10.23. | ||
// | ||
|
||
import Foundation | ||
/// Represents an extension of ``Order`` introducing analytics information, | ||
/// e.g. adding to this order iceberg related information ``icebergPeakSize``, ``IcebergHiddenSize``, ``IcebergExecutedSize`` | ||
/// | ||
/// The collection of analytic order events of a symbol represents the most recent analytic information | ||
/// that is available about orders on the market at any given moment of time. | ||
/// | ||
/// [For more details see](https://docs.dxfeed.com/dxfeed/api/com/dxfeed/event/market/AnalyticOrder.html) | ||
public class AnalyticOrder: OrderBase { | ||
public override var type: EventCode { | ||
return .analyticOrder | ||
} | ||
/* | ||
* Analytic flags property has several significant bits that are packed into an integer in the following way: | ||
* 31...2 1 0 | ||
* +--------------+-------+-------+ | ||
* | | IcebergType | | ||
* +--------------+-------+-------+ | ||
*/ | ||
|
||
// TYPE values are taken from Type enum. | ||
private let icebergTypeMask = 3 | ||
private let icebergTypeShift = 0 | ||
|
||
/// Gets or sets iceberg peak size of this analytic order. | ||
public var icebergPeakSize: Double = .nan | ||
/// Gets or sets iceberg hidden size of this analytic order. | ||
public var icebergHiddenSize: Double = .nan | ||
/// Gets or sets iceberg executed size of this analytic order. | ||
public var icebergExecutedSize: Double = .nan | ||
/// Gets or sets iceberg type of this analytic order. | ||
public var icebergFlags: Int32 = 0 | ||
/// Initializes a new instance of the <see cref="AnalyticOrder"/> class. | ||
public override init(_ eventSymbol: String) { | ||
super.init(eventSymbol) | ||
} | ||
|
||
/// Returns string representation of this candle event. | ||
public override func toString() -> String { | ||
return | ||
""" | ||
AnalyticOrder{\(baseFieldsToString()), \ | ||
icebergPeakSize=\(icebergPeakSize), \ | ||
icebergHiddenSize=\(icebergHiddenSize) + | ||
icebergExecutedSize=\(icebergExecutedSize) + | ||
icebergType=\(icebergType)} | ||
""" | ||
} | ||
} | ||
|
||
extension AnalyticOrder { | ||
/// Gets or sets iceberg type of this analytic order. | ||
public var icebergType: IcebergType { | ||
get { | ||
IcebergTypeExt.valueOf(value: BitUtil.getBits(flags: Int(icebergFlags), | ||
mask: icebergTypeMask, | ||
shift: icebergTypeShift)) | ||
} | ||
set { | ||
icebergFlags = Int32(BitUtil.setBits(flags: Int(icebergFlags), | ||
mask: icebergTypeMask, | ||
shift: icebergTypeShift, | ||
bits: newValue.rawValue)) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// IcebergType.swift | ||
// DXFeedFramework | ||
// | ||
// Created by Aleksey Kosylo on 11.10.23. | ||
// | ||
|
||
import Foundation | ||
|
||
/// Type of an iceberg order. | ||
public enum IcebergType: Int, CaseIterable { | ||
/// Iceberg type is undefined, unknown or inapplicable. | ||
case undefined = 0 | ||
/// Represents native (exchange-managed) iceberg type. | ||
case native | ||
/// Represents synthetic (managed outside of the exchange) iceberg type. | ||
case synthetic | ||
} | ||
|
||
/// Class extension for ``IcebergType`` enum. | ||
public class IcebergTypeExt { | ||
private static let values: [IcebergType] = | ||
EnumUtil.createEnumBitMaskArrayByValue(defaultValue: .undefined, allCases: IcebergType.allCases) | ||
|
||
/// Returns an enum constant of the``IcebergType`` by integer code bit pattern. | ||
/// - Parameters: | ||
/// - value: Property value | ||
/// - Returns: The enum constant of the specified enum type with the specified value | ||
public static func valueOf(value: Int) -> IcebergType { | ||
return values[value] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// | ||
// OrderAction.swift | ||
// DXFeedFramework | ||
// | ||
// Created by Aleksey Kosylo on 06.10.23. | ||
// | ||
|
||
import Foundation | ||
|
||
public enum OrderAction: Int, CaseIterable { | ||
/// Default enum value for orders that do not support "Full Order Book" and for backward compatibility - | ||
/// action must be derived from other ``Order`` | ||
case undefined = 0 | ||
/// New Order is added to Order Book. | ||
case new | ||
/// Order is modified and price-time-priority is not maintained (i.e. order has re-entered Order Book). | ||
case replace | ||
/// Order is modified without changing its price-time-priority (usually due to partial cancel by user). | ||
case modify | ||
/// Order is fully canceled and removed from Order Book. | ||
case delete | ||
/// Size is changed (usually reduced) due to partial order execution. | ||
case partial | ||
/// Order is fully executed and removed from Order Book. | ||
case execute | ||
/// Non-Book Trade - this Trade not refers to any entry in Order Book. | ||
case trade | ||
/// Prior Trade/Order Execution bust | ||
case bust | ||
} | ||
|
||
internal class OrderActionExt { | ||
private static let values: [OrderAction] = | ||
EnumUtil.createEnumBitMaskArrayByValue(defaultValue: .undefined, allCases: OrderAction.allCases) | ||
|
||
public static func valueOf(value: Int) -> OrderAction { | ||
return values[value] | ||
} | ||
} |
Oops, something went wrong.