|
Documentation |
|||
|
Available Topics: Things to
know
Application Specific Information: Investor RT
Tutorial
|
Automated Trading Listen to an audio presentation here. Automated Trading allows you to integrate NinjaTrader with various charting applications in order to automate your trading systems. This means that you are able to turn generated trading signals into sets of order instructions that will be processed and passed through NinjaTrader to Interactive Brokers TWS. You will find charting application specific help and tutorials on the links to your left. NT supports passive integration through "Order Instruction Files" (OIF) read from the NinjaTrader application install directory. By checking the "AT" checkbox in the upper right hand corner of the main NT window, NT will be instructed to check the above directory at user specified intervals set in the 'SETTINGS' manager for new OIFs. NT offers Direct Automation and Passthrough Automation. Most charting applications have the ability to export user defined text files based on trading signals generated within the charting application. NT reads the instructions from these text files and automatically passes the order information to TWS. Direction Automation Direct Automation is where the order processed is managed within NT once filled. All NT order parameters are supported in this mode. You can only process and manage one open position at a time in this mode. NT MUST contain the symbol in the symbol manager for the order that is being placed. The symbol DOES NOT need to be the active SYMBOL #1. If NT currently is managing an open position, any new order placement information will be ignored. NT is an optional multi-step automated system. Once the initial order is processed and submitted to TWS, you can modify or cancel the order manually, or through automation using Cancel or AdjustEntry OIF's all before its filled. Once an order is filled, you can manage the position manually through NT, or through automation using STOP order Adjustments OIF's and Close Position OIF's. You can have NT notify you for each new order being processed and provide you with an option to process the order or ignore it. This option is set under "SETTINGS". There are several different OIF's that NT can process. They are Entry OIF, Cancel OIF, AdjustEntry OIF, STOP/TARGET Adjustment OIF, Close OIF and Reverse OIF. NT returns information through several files. Upon initial entry and final exit, NT passed transaction information back through Entry and Exit Update Files. The position.txt file returns the state of NT.
The Entry OIF must be placed in the NinjaTrader application install directory, named entry.txt and must be in the following format on a single line: The parameters MUST be in the following order, and in CAPS. "SYMBOL","ACTION","CONTRACTS/SHARE QTY","CONTRACTS SHARE QTY2","EXIT TYPE","ORDER TYPE","LIMIT PRICE","STOP PRICE","TARGET 1 OFFSET","TARGET 2 OFFSET","STOP OFFSET","BREAKEVEN TRIGGER OFFSET","BREAKEVEN PLUS","LIMIT PRICE 2","STOP PRICE 2", Where: Symbol : Instrument symbol (this
must already exist in the NT symbol manager) "Limit and Stop Price 2" parameters are used when send an OCA entry pair to NinjaTrader. They will represent the lower priced order where "Limit and Stop Price" parameters will represent the higher priced order. If sending an OCA entry pair, the "Action" parameter must be left blank. Each new OIF can not be an appended file. It must be a new file, with a single line instruction set. NT will monitor the install directory for this file. Whenever a new file is deposited, NT will process the instructions (provided that there is no current open position) and pass an order to TWS. A short whistle sound will play each time an OIF file is processed and an order is submitted. NT will cease monitoring for entry.txt until either the entry order is cancelled or a filled position is closed. If the order is pending (not yet filled), NT monitors for a cancel.txt and a adjustentry.txt OIF. Upon a successful fill, NT will cease monitoring for these files. NT will now begin to monitor for a close.txt, reverse.txt and a adjuststoptarget.txt OIF. See example.
The Cancel OIF must be placed in the Ninjatrader application install directory , be named cancel.txt and must be in the following format: "SYMBOL","CANCEL", NT will monitor the above directory for this file only after an order is placed through automation. NT will cancel the pending order if the symbol matches the pending order symbol. NT will then cease monitoring for Cancel and AdjustEntry OIF's and resume monitoring for ENTRY OIF's.
The AdjustEntry OIF must be placed in the Ninjatrader application install directory, be named adjustentry.txt and must be in the following format: "SYMBOL","UPPER LIMIT /DEFAULT LIMIT","UPPER STOP/DEFAULT STOP","LOWER LIMIT","LOWER STOP", NT will monitor the above directory for this file only after an order is placed through automation. NT will adjust the current entry price to the value(s) specified only if the symbol matches the current orders symbol.
The STOP Order Adjustment OIF must be placed in the Ninjatrader application install directory , be named adjuststoptarget.txt and must be in the following format: "SYMBOL","STOP PRICE","TARGET PRICE", NT will monitor the above directory for this file only after an order is filled through automation. NT will adjust the current positions STOP LOSS order to the value specified only if the symbol matches the current position's symbol. Price parameters must have a minimum value of zero.
The CLOSE Position OIF must be placed in the c:\ninjatrader directory or the directory in which you installed NinjaTrader, and be named close.txt and must be in the following format: "SYMBOL","CLOSE", NT will monitor the above directory for this file only after an order is filled through automation. NT will close the current position if the symbol matches the open position. From this point, NT will cease monitoring for STOP Order Adjustment and CLOSE Position OIF's and resume monitoring for ENTRY OIF's.
Reverse OIF. This command will close and reverse your current position. Order parameters are based on the parameters displayed in the order parameters section at the time the file is processed. The file must be submitted to the NinjaTrader installation directory and named reverse.txt and is in the following format: "SYMBOL","REVERSE",
These files are generated upon initial fill and upon final exit. The files are located in the NinjaTrader installation directory and named automatedentryupdate.txt and automatedexitupdate.txt and are in the following format: "SYMBOL","ACTION","PRICE","QTY","DATE/TIME",
This file is updated at different stages within the order processing flow. The file is located in the NinjaTrader installation directory and named position.txt and is in the following format: "STATE", Possible values are: LONG, SHORT, PENDING or FLAT
|
||
|
Passthrough automation is where NT processes the OIF's and passes orders directly to TWS with an accompanying set of OCA STOP and PROFIT orders. NT does NOT manage the order once it is filled. This mode is optional (set in "SETTINGS") and runs in parallel to Direct Automation mode. If NT is managing an open position, Passthrough automation will still be active and place orders. It is important to know, when Passthrough Automation is processing a valid OIF for order placement, NT will delete this file once the entire order entry and OCA STOP and PROFIT order submission is complete. Its also important to note that symbols specified in OIF's for PassThrough processing does NOT need to be contained in NT's symbol manager.
PassEntry OIF The PassEntry OIF must be placed in the Ninjatrader application install directory , named passentry.txt and be in the following format on a single line: "ACTION","CONTRACTS/SHARE QTY","SYMBOL","SECTYPE","EXPIRY","EXCHANGE","ENTRY ORDERTYPE","LIMIT PRICE","STOP PRICE","TARGET OFFSET","STOP OFFSET","INCREMENT","EXIT ORDER TYPE","STOP LIMIT OFFSET","TIME IN FORCE", Where: Action : Valid values are "BUY" or "SELL" NT monitors for this file at the same specified interval as the other OIF's although there is a programmed offset to stagger the monitoring 1/10 of a second behind the Direct Automation file monitoring intervals. This is to avoid possible OIF's crashing NT at the exact same moment. Passthrough automation is powerful if you have multiple trade signals generated within close proximity. NT will allow you to sit back while all of your trade signals are converted to real-time open positions with protective STOP LOSS and PROFIT orders.
|
|||