syntax = "proto3";

package IBProto;

import "Contract.proto";
import "TagValue.proto";

message ScannerSubscription {
    optional int32 numberOfRows = 1;
    optional string instrument = 2;
    optional string locationCode = 3;
    optional string scanCode = 4;
    optional double abovePrice = 5;
    optional double belowPrice = 6;
    optional int64 aboveVolume = 7;
    optional double marketCapAbove = 8;
    optional double marketCapBelow = 9;
    optional string moodyRatingAbove = 10;
    optional string moodyRatingBelow = 11;
    optional string spRatingAbove = 12;
    optional string spRatingBelow = 13;
    optional string maturityDateAbove = 14;
    optional string maturityDateBelow = 15;
    optional double couponRateAbove = 16;
    optional double couponRateBelow = 17;
    optional bool excludeConvertible = 18;
    optional int64 averageOptionVolumeAbove = 19;
    optional string scannerSettingPairs = 20;
    optional string stockTypeFilter = 21;
    repeated TagValue scannerSubscriptionFilterOptions = 22;
    repeated TagValue scannerSubscriptionOptions = 23;
}

message ScannerSubscriptionRequest {
    optional int32 reqId = 1;
    optional ScannerSubscription subscription = 2;
}

message ScannerDataElement {
    optional int32 rank = 1;
    optional Contract contract = 2;
    optional string marketName = 3;
    optional string distance = 4;
    optional string benchmark = 5;
    optional string projection = 6;
    optional string comboKey = 7;
}

message ScannerData {
    optional int32 reqId = 1;
    repeated ScannerDataElement data = 2;
}
