Navigation: Trading Your System >

Generated Order Types

 

 

 

 

Generated Order Types

The following is a complete list of possible order-producing strategy elements showing the specific order types and attributes that will are generated:

Strategy Elements

Related Time Setting

TYPE

TIF

Good Until Time

Good After Time

EntrySetup (no stop or limit)

none or NextOpen

MKT

DAY

 

 

EntrySetup (no stop or limit)

NextClose

MOC or MKT*

DAY

 

15:58*

 

 

 

 

 

 

EntrySetup + EntryLimit

none

LMT

DAY

 

 

EntrySetup + EntryLimit

NextOpen

LMT

OPG

 

 

EntrySetup + EntryLimit

NextClose

LOC or LMT*

DAY

 

15:58*

 

 

 

 

 

 

EntrySetup + EntryStop

none

STP

DAY

 

 

EntrySetup + EntryStop

NextOpen

STP

GTD

9:31*

 

EntrySetup + EntryStop

NextClose

STP

DAY

 

15:58

 

 

 

 

 

 

EntrySetup + EntryStop + EntryLimit

none

STP LMT

DAY

 

 

EntrySetup + EntryStop + EntryLimit

NextOpen

STP LMT

GTD

9:31*

 

EntrySetup + EntryStop + EntryLimit

NextClose

STP LMT

DAY

 

15:58

 

 

 

 

 

 

ExitRule

none or NextOpen

MKT

DAY

 

 

ExitRule

NextClose

MOC or MKT*

DAY

 

15:58*

 

 

 

 

 

 

ExitLimit

none

LMT

DAY

 

 

ExitLimit

NextOpen

MKT

DAY

 

 

ExitLimit

NextClose

LOC or LMT*

DAY

 

15:58

 

 

 

 

 

 

ExitStop

none

STP

DAY

 

 

ExitStop

NextOpen

MKT

DAY

 

 

ExitStop

NextClose

STP

DAY

 

15:58

* order type and time depends on exchange capabilities and settings as defined in ExchangeMap.csv

 

Special Case for "Day Trade" Strategies

The table above does not cover the ThisClose time setting. That setting is generally not compatible with in-advance order generation as it requires knowledge of the current nearly-completed bar to calculate the strategy formulas.

The one exception to this rule is a type of strategy that enters positions with limit orders and exits that same day with an MOC order as its only exit rule.

To specify this type of strategy so that RealTest automatically generates correct orders, use:

This will generate a "child" MOC exit order attached to each "parent" entry order.

The entry order is then generated with GTD as its TIF and 15:40 as its expiration time (time can be changed in ExchangeMap.csv).

 

Support for International Exchanges, Order Types, and Time Zone Names

RealTest uses an ExchangeMap to determine how to correctly map available symbol metadata to correct brokerage orders.

See the above link for full details about the contents and usage of this map file.

The information it contains is used with the OrdersTemplate (also with OrderClerk) to ensure that:

symbols are correctly translated from Norgate to IB format

the correct SMART/xxx exchange definition is used in each order

MOC orders are generated where supported, otherwise GAT <time> is used

parent LMT entry orders for MOC exit strategies are placed with GTD <time> as appropriate

NextClose orders are placed as GAT <time> correctly for each exchange (to become "NearClose" orders)

Note that IB does not require the xxx in SMART/xxx to be the exchange on which a stock is listed. It only needs to pin it to the correct stock market, so that the symbol will not be ambiguous. For example, "SMART/AMEX" works fine for all US stocks even though most of them are not listed on AMEX.

 

Norgate to IB Futures Symbol Mapping

RealTest includes a file called ibfutures.csv. This file maps Norgate futures symbols to the corresponding IB symbols when there are differences.

The default contents are:

If you find others, feel free to add them.

Note that for any Norgate futures contract symbol, RealTest will automatically change the name to the correct IB format when creating a CSV order basket. For example, ES-2022M would become ESM2, and (also using mapping) 6E-2022M would become EURM2.

To use the ibfutures.csv symbol mapping file, you must add SymChangeList: ibfutures.csv to your script's Settings section.

 

 

 

 

Copyright © 2020-2024 Systematic Solutions, LLC