• C#
  • Java
  • VB
  • C++
  • Python
Contact us
Quantitative Brokers Algos
  • It is recommended to first try to create the QBAlgo in TWS to see the most current available field values.
  • QBAlgos are only available in live accounts.
  • Some fields have default values and are optional in TWS but must be explicitly specified in the API.

Available QBAlgos

Strobe

Bolt

Closer

Octane


Strobe

Parameter Description Type Syntax/Values
StartTimeStart Time Time hh:mm:ss tmz
EndTimeMust be on the same date as Start Time.
Takes precedence over Duration.
Time hh:mm:ss tmz
DurationAlternative order end time specifier.
This value is a number of minutes that the order should be worked.
A value of -99 will specify that the end time should be the exchange close time.
Double
BenchmarkBenchmark String TWAP, VWAP
PercentVolumeVolume % Double >=0 and <=1
NoCleanupNo Cleanup Boolean "0" (false) or "1" (true)

Bolt

Parameter Description Type Syntax/Values
StartTimeStart Time Time hh:mm:ss tmz
EndTimeMust be on the same date as Start Time.
Takes precedence over Duration.
Time hh:mm:ss tmz
DurationAlternative order end time specifier.
This value is a number of minutes that the order should be worked.
A value of -99 will specify that the end time should be the exchange close time.
Double
ModeMode String Passive, Normal, Aggressive
PercentVolumeVolume % Double >=0 and <=1
EventPauseEvent Pause String Attempt_To_Complete, Pause_Trading, Trade_Through
NoCleanupNo Cleanup Boolean "0" (false) or "1" (true
LiquidityAggressThresholdLiquidity Aggressiveness Threshold Double >=0 and <=1

Closer

No Parameters

Octane

Parameter Description Type Syntax/Values
StartTimeStart Time Time hh:mm:ss tmz
EndTimeMust be on the same date as Start Time.
Takes precedence over Duration.
Time hh:mm:ss tmz
DurationAlternative order end time specifier.
This value is a number of minutes that the order should be worked.
A value of -99 will specify that the end time should be the exchange close time.
Double
UrgencyUrgency String High, Ultra_High


Example Quantitative Brokers Strobe Algo

  • ...
    ...
  • Contract contract = new Contract();
    contract.symbol("ES");
    contract.secType("FUT");
    contract.exchange("QBALGO");
    contract.currency("USD");
    contract.lastTradeDateOrContractMonth("202003");
    ...
    AvailableAlgoParams.FillQBAlgoInlineParams(baseOrder, "10:00:00 US/Eastern", "16:00:00 US/Eastern", -99, "TWAP", 0.25, true );
    client.placeOrder(nextOrderId++, ContractSamples.QBAlgoContract(), baseOrder);
    ...
    public static void FillQBAlgoInlineParams(Order baseOrder, String startTime, String endTime, double duration, String benchmark,
    double percentVolume, boolean noCleanUp) {
    baseOrder.algoStrategy("STROBE");
    baseOrder.algoParams(new ArrayList<>());
    baseOrder.algoParams().add(new TagValue("StartTime", startTime));
    baseOrder.algoParams().add(new TagValue("EndTime", endTime));
    //This example uses endTime instead of duration
    //baseOrder.algoParams().add(new TagValue("Duration", String.valueOf(duration)));
    baseOrder.algoParams().add(new TagValue("Benchmark", benchmark));
    baseOrder.algoParams().add(new TagValue("PercentVolume", String.valueOf(percentVolume)));
    baseOrder.algoParams().add(new TagValue("NoCleanUp", noCleanUp ? "1" : "0"));
    }
  • ...
    ...
  • ...
    ...
  • 1  contract = Contract()
    2  contract.symbol = "ES"
    3  contract.secType = "FUT"
    4  contract.exchange = "QBALGO"
    5  contract.currency = "USD"
    6  contract.lastTradeDateOrContractMonth = "202003"
    ...
    1  AvailableAlgoParams.FillQBAlgoInLineParams(baseOrder, "10:00:00 US/Eastern", "16:00:00 US/Eastern", -99, "TWAP", 0.25, True)
    2  self.placeOrder(self.nextOrderId(), ContractSamples.QBAlgoContract(), baseOrder)
    ...
    1  @staticmethod
    2  def FillQBAlgoInLineParams(baseOrder: Order, startTime: str,
    3  endTime: str, duration: float,
    4  benchmark: str, percentVolume: float,
    5  noCleanUp: bool):
    6  # must be direct-routed to "QBALGO"
    7  baseOrder.algoStrategy = "STROBE"
    8  baseOrder.algoParams = []
    9  baseOrder.algoParams.append(TagValue("StartTime", startTime))
    10  baseOrder.algoParams.append(TagValue("EndTime", endTime))
    11  #This example uses endTime instead of duration
    12  #baseOrder.algoParams.append(TagValue("Duration", str(duration)))
    13  baseOrder.algoParams.append(TagValue("Benchmark", benchmark))
    14  baseOrder.algoParams.append(TagValue("PercentVolume", str(percentVolume)))
    15  baseOrder.algoParams.append(TagValue("NoCleanUp", int(noCleanUp)))