Practical Aspects of Integrated Trading with Interactive Brokers (IB)

This is a practical guide to setting up integrated trading with Interactive Brokers. It contains practical advice beyond that offered by our help files, and it should be read by anyone considering trading with IB automatically using NeuroShell’s Integrated Trading Feature.

I. Things to Consider First

1.	Is integrated trading really right for you?

Integrated trading (sending trades automatically from NeuroShell to your broker) is not for everyone.  If you are trading frequently during the day using intraday bars it certainly makes sense. If your trades are infrequent and not particularly time sensitive, it probably makes less sense.  If you do not own the NeuroShell DayTrader and you trade once a day using daily bars after they close in the evening, it may not make much sense at all unless you trade dozens of symbols.

NeuroShell’s integrated trading does not automatically “sync up” to IB if there is an interruption in communications or a failure of any of the programs involved. You should weigh this carefully and make sure you are prepared to manually rectify the account positions should a failure occur (see the topic V. Interruptions below).

2.	Is IB really the right choice?
 
      There is an excellent integrated trading interface to PFGBest, a smaller broker 
             than IB, but more flexible and familiar with NeuroShell. They  actually wrote and 
             support  their own NeuroShell trading interface, much less complicated than the 
             IB Trader Workstation (TWS) and the IB programmer’s interface (API). They
             have smaller initial account requirements and provide a discount on eSignal
             subscriptions.

3.	Are you prepared?

Integrated trading is not for beginners. You should not even attempt to use integrated trading until you are very familiar with NeuroShell and the models you are planning to trade. You should also be familiar with the workings of the TWS, having traded or paper traded in the TWS directly with the exact types of issues you plan to trade automatically (e.g. futures, FX, equities). To not follow this advice is to invite extreme frustration for you as well as us as we attempt to help you.  Please do not be in a hurry to try out integrated trading.

4.	Do NOT install the IB API !!!!!!!

IB changes their interfaces frequently and without notice. NeuroShell may not always utilize the latest IB API, and IB has not in the past been careful about making their new versions compatible with their old ones. NeuroShell installs the correct IB API when you install NeuroShell, and you should not do anything further than install the TWS.

If you have already installed the IB API in order to automatically trade IB from Excel or some other software besides NeuroShell, our Integrated trading will probably not function, and you will need to remove the wrong API, which is not an easy thing to do. It may therefore not be possible to do integrated trading with both NeuroShell and the other software through IB. See Appendix D for instructions on removing the wrong API.

The following error is likely if you have installed the API yourself:

             "The currently installed and registered Interactive Brokers API is not compatible with this 
                    version of NeuroShell Trader." 

II. Before You Start

1.	Is your IB account ready?

If you are not authorized by IB to trade certain instruments, integrated trading may not work on those instruments, even with the paper trading account (see below).  Unfortunately, IB rarely issues illuminating error messages through the API interface when symbols cannot be traded. So make sure your account is set up the way you want it before you start.

2.	Do you have a paper trading account with IB?

A paper trading account is free, and a must to practice trading or integrated trading before risking real money. NeuroShell connects to whatever account is currently signed on to the TWS, so use the paper trading account in TWS extensively until you are sure the interface and your model are working smoothly and correctly.  

Before you try automated trading, practice manually trading in the TWS without NeuroShell. Use the same symbols you plan to trade from NeuroShell. Do not use IB specialized platforms like the FX Trader or the Book Trader, because the IB interface does not connect with those. In the past users have reported problems trading with integrated trading to learn only later that the symbols they were trading couldn’t be traded manually in the TWS either.

NeuroShell only connects to one account at a time on a particular computer, and that is the account currently active in the TWS.

3.	Setting up the Trader Workstation (TWS)
The first thing you must do is activate client support by configuring the IB Trader Workstation (TWS). Go to the ‘Configure’ Menu on the TWS menu screen, select the ‘API’ menu item and make sure the ‘Enable ActiveX and Socket Clients’ is checked.
Next set up your computer as a trusted IP address, so that the TWS doesn’t constantly ask you if you want to let NeuroShell connect. You do this in the same API menu on the TWS.  Select All API Settings, and then created a “Trusted IB address” of 127.0.0.1
4.	Selecting the brokerage in NeuroShell

The Tools  > Options >Trading orders menu in NeuroShell is where you go to set up integrated trading.  There is where you will select the interface to your brokerage. At this writing, the only available brokerage interfaces are IB and PFGBest. The IB interface is installed with NeuroShell, and the PFGBest interface needs to be obtained and installed from PFGBest. 

There are two IB interfaces. If you are going to Trade an IB Advisor account, choose “Interactive Brokers Advisor Profile”, otherwise choose “Interactive Brokers”

The Ticker and Exchange Mapping button is described in “Getting the Symbols Right” below. 

5.	Advisors Accounts

     If you are trading an Interactive Broker’s Advisor Account and have selected the 
     “Interactive Brokers Advisor Profile” from NeuroShell’s Brokerage dropdown list, 
     then you must also have a ‘NeuroShell’ allocation profile setup within the IB 
     Trader Workstation (TWS).
To create an allocation profile in the IB Trader Workstation (TWS), go to the ‘Configure’ Menu on the TWS menu screen, select the ‘Advisor’ menu item and then select ‘Allocation Profiles’. You will then need to create a profile by the name of ‘NeuroShell’ which specifies how trades made from NeuroShell will be allocated between the available accounts. The profile name MUST be named NeuroShell to work correctly. Follow IB instructions on how to create an Advisor profile named “NeuroShell”.

III. Getting the Symbols Right

1.	Why this is important

The most common problem our users have with integrated trading with IB is that the TWS rejects orders saying only that the symbol is incorrect. You even have to get the exact number of spaces in the symbols correct, or TWS will reject it. For example these two futures symbols, shown with b to indicate a blank space:

ESH0
YMbbbDECb06

FX symbols are designated with a period separating the currencies in the pair, not a slash, as follows:

AUD.JPY
EUR.USD

2.	Finding out the correct IB symbol to use

The best way to find the correct ticker symbol in IB is to first insert it into the TWS in one of the Order Management tabs (usually the Untitled one).  If you don’t know how to do this, get assistance from IB. 

Now go to the TWS View menu and select “Symbol mode” instead of “Underlying mode”. The correct IB symbol should now show up in the Symbol column, and the correct exchange should show up in the “Exchange” column.

For more details on finding the correct IB symbol, see Appendix E.

3.	Mapping the data feed symbol to the brokerage symbol

This is a crucial step, because possibly except for stock symbols, the data feed tickers almost never match the IB tickers, not even the IBFeed tickers.  Even if you are trading equities and the symbols match, you should probably tell IB the correct exchange, e.g. SMART.

To tell NeuroShell what symbol to instruct IB to trade when it gets a signal from the datafeed symbol on your chart(s), go to Tools > Options and press the “Ticker and Exchange mapping…” button. The “Add Mapping” button allows you to correspond an IB symbol and exchange with a datafeed ticker.  Be sure to set the Brokerage Security type too (use Cash for FX). See the next section for instructions on setting the exchange correctly in this dialog box.

Example:  The eSignal symbol ESbH0 will need to be mapped to ESH0 and Exchange = GLOBEX/USD and Brokerage Security Type = FUT

4.	Setting the exchange and currency correctly

Several months ago without warning IB started requiring the trading currency to be designated as well as the symbol and the exchange, but only for some symbols. As far as we know, they never made it clear WHICH symbols require a trading currency to be designated, so it is best to designate as a matter of course. If you are in the USA, your currency is USD, and it is specified by placing a slash and USD after the exchange designation, e.g.:

SMART/USD  or SMART\USD
GLOBEX/USD  or GLOBEX\USD

One exception is when trading currency pairs. If you are trading EUR.USD then USD works. However, if you are trading a cross pair like AUD.JPY then leave the USD currency off of the IDEALPRO exchange designation, or IB will not recognize your symbol.

5.	Some symbols cannot be traded fully

There are still issues that quote prices in the old fractional method in 16ths, 32nds, etc. These symbols can be traded in NeuroShell with Integrated trading, but at this writing IB insists that limit prices be the exact fractions. NeuroShell cannot be made to set limit prices as exact fractions, so these issues will need to be traded with market orders. 

One example is 30 year T Bonds (ZB on the ECBOT).

IV. Position sizes

     1. NeuroShell has the ability to set point values for contracts like futures and FX
     contracts. However, these point values are for NeuroShell to use in calculating profits
     and statistics, and they are not sent to IB. So if you send a trade of 2 contracts to IB, 
     the size of those contracts is determined by IB, not by NeuroShell. 

     2. Most users trade FX with IB these days by using dollar amounts rather than fixed
     sized contracts. Again, NeuroShell’s point values play no part in the interaction with
     IB. If you want to trade $50,000 of FX with IB, make your position size in NeuroShell
     50,000, but leave the point value at 1 so that NeuroShell calculates profits correctly.

     3. Getting position sizes right is another reason you should practice trading manually 
      with the IB TWS before trying to trade from NeuroShell.

V. Interruptions

      There are many reasons why integrated trading can be interrupted, including:
    
         1. IB shuts the TWS down once per day, but you can adjust the time (in the TWS
           Configuration menu, see “Lock and exit”).

         2. Internet communications failure

         3. TWS failure

4.	NeuroShell failure

5.	Windows failure

6.	System reboots caused by Windows or anti-virus program updates

    If any failure occurs, including one of the above, NeuroShell cannot automatically 
    restart and there is no guarantee that when everything is running again, that
    NeuroShell and the TWS will be synchronized with respect to positions  and orders.
   It will be your responsibility to make sure that the NeuroShell charts you are trading
   are still in the correct positions before you continue integrated trading. If you are in
   doubt, or cannot do that, close out all your  positions manually in the TWS, and 
  rebacktest the NeuroShell chart in order to start trading fresh.

   However, if you want to shut down NeuroShell while you still have open positions, save the chart(s) you are trading first. NeuroShell then “remembers” open positions in the chart, and when you reload the chart(s) NeuroShell will ask if you are still in the same positions. If you are, NeuroShell will contine in those positions. If not, NeuroShell will assume you are starting over with new positions.

VI. Other Issues

1.	Be aware that NeuroShell will only send trades to IB upon the close of the current bar. If you load NeuroShell, no signals that have already occurred will be sent. 

2.	Also, if your model is defective in a way that generates trades for older bars, those trades will not be sent either. There have been cases where users see older trades that were never sent, and the problem turned out to be that their model was using inputs or rules that did not fire until several bars had passed. This can happen if your inputs or rules either look into the future, or change in the past based on new data.

VII. Trouble Shooting

      If you experience problems that are not covered in this document, you can bring them 
      to the attention of our technical support. However, please reproduce the problem after 
      taking the following steps:

1.	Download and install the latest version of NeuroShell from www.ward.net. If there is a current beta version available, download and install that.

2.	Before you start NeuroShell, manually erase the following files in the NeuroShell root folder:
           inttrd.log
           inttrd2.log
           inttrd3.log
           inttrd4.log

3.	Reproduce the problem that you saw before. As soon as the problem occurs, save the chart with a new name and with data included in it (when you select “Save as…” you will see an option to include data).

4.	If you know how, take a jpg image of the screen.

5.	Locate a file in the NeuroShell folder, subfolder BrokerageServers called “Interactivebrokers.map” or “Interactivebroker Advisor Profile.map”.

6.	Send an email to support@wardsystems.com with a detailed description of what the problem is and exactly on what bar it occurred. Attached the saved chart, the jpg image, and all the .log files above that you see (they will have been re-generated), and the .map file. 

Appendix A – How NeuroShell Interacts with IB

Order Types: 

NeuroShell Trader supports only the “Market”, “Limit”, “Stop”, and “Stop Limit” order types for Interactive Brokers. 

All other order types are currently unsupported (i.e. order types like “Limit if Touched”, “Trailing Stop”, “Market if Touched”, etc. are unsupported).

Note that Stop and Limit orders are NOT simulated orders, where by NeuroShell Trader would monitor the price action and send out a market order to your brokerage when the price has been reached. The Stop and Limit orders in NeuroShell Trader are actual Stop and Limit orders that get placed with your Brokerage at the end of a price bar. The brokerage will forward the order to the actual market being traded and the order will sit in the market waiting to get executed until the specified stop or limit price has been reached (or until NeuroShell Trader cancels or modifies the order on a subsequent price bar). 

For markets that do not accept stop or limit orders, please contact your Brokerage about how they handle stop and limit orders for that particular market. The brokerage may either simulate the stop or limit order on their computer system or they may simply not accept stop or limit orders for that particular market.

Duration of Orders:

NeuroShell Trader currently places all orders as GTC (Good till Cancelled) with Interactive Brokers. However, keep in mind that NeuroShell Trader will cancel any open orders necessary due to the logic of a Trading Strategy. 

Take for example a Trading Strategy setup to place a Limit or Stop order only when the last bar’s volume exceeds 10,000. In this case, NeuroShell Trader will place the Limit or Stop order with Interactive Brokers when a bar expires with a volume exceeding 10,000. NeuroShell Trader will keep the Limit/Stop order active as long as each successive bar’s volume exceeds 10000 and the Limit/Stop order has not been filled. However, NeuroShell Trader will send Interactive Brokers a command to cancel the Limit/Stop order on the first subsequent bar with a volume less than 10,000 if the Limit/Stop order has not yet been filled.

Simultaneous Orders

There is currently no support for OCO (One Cancels Other) or OCA (One-Cancels-All) group orders. However, keep in mind that NeuroShell Trader will cancel any simultaneous order pairs that need canceling due to the confirmed order fill of one of the orders. 

Take for instance a Trading Strategy that has a simultaneous protective stop and price target limit order exits. In this scenario, NeuroShell Trader will place both a stop order to exit and a limit order to exit with Interactive Brokers. When NeuroShell Trader receives a confirmation that one of the orders has been filled, it will immediately send Interactive Brokers a command to cancel the opposite order of the pair.

Order Fills

Fill prices from Interactive Brokers will be communicated back to NeuroShell Trader for use in the Trading Strategy. Even if price action on the chart makes it appear as if a fill should have occurred, NeuroShell Trader will only actually fill an order and proceed with subsequent trading strategy orders after Interactive Brokers has returned a fill price. If Interactive Brokers does not fill the order, neither will the NeuroShell Trading Strategy. This guarantees that the Trading Strategy will not get out of step with the orders/fills occurring with Interactive Brokers and also allows you to view the actual fill prices and related statistics within NeuroShell Trader.

Partial Fills

NeuroShell Trader will wait until Interactive Brokers returns confirmation that an order is completely filled before proceeding with subsequent trading strategy orders. In the case that an entry order is partially filled when the Trading Strategy needs to cancel an order, NeuroShell Trader will automatically adjust any subsequent order sizes to reflect the partial fill. 

Take for instance a Long Entry order for 100,000 shares which has only been filled partially with 20,000 shares at the time that a Short Entry reversal signal to short 100,000 shares occurs. In this case, NeuroShell Trader will send out a cancel message for the Long Entry order. NeuroShell Trader then waits for confirmation that the order is canceled. Once confirmed cancelled, NeuroShell will reverify the final number of shares filled by the Long Entry order just in case more shares were filled between the time of the cancel being placed and the cancel confirmation. NeuroShell Trader will then place a sell order for the long position shares and the desired short position. So in this case a sell order for 120,000 shares would be placed to both exit the partially filled long position of 20,000 shares and take a short position of 100,000 shares.

What is the difference between the Protective Stops tab and the Exit tab with Stop Order selected?

The only difference is that selecting a stop order on the Exit tab will conditionally fire stop orders based upon the exit condition, whereas specifying a stop price on the Protective Stop tab will fire stop orders on every bar if the price changes (canceling the old ones).

So for example a stop price of Sub(High,5) put in the Protective Stops tab would send out a stop order 5 points below the high at the end of each bar while still in a position. 

However, a stop price of Sub(High,5) entered under the Exit tab with a condition of volume exceeds 10,000, would only send out a stop order 5 points below the high at the end of each bar in which the volume exceed 10,000 and still in a position. On bars where the volume was less than 10,000, no exit stop order would be placed and in fact if the previous bar had a volume exceeding 10,000, then the old stop order would be canceled.

It should be noted that there is absolutely no functional difference between specifying a stop price on the Protective Stop tab and specifying the same stop price on an exit tab whose order type is selected to be a Stop Order and whose exit condition is always true.

When are Protective Stops and Exit Orders placed relative to the Entry Order:

If the entry is made with a market order, then exit stop and exit limit orders specified on the Protective Stop and/or Exit Tab will be evaluated and fired on the same bar that the entry condition was true. This allows a stop and/or limit exit to be placed at the same time that a market order entry is placed. 

However, if the entry is based upon a stop or limit order instead of a simple market order, then the Protective Stop and Exit tabs will not be evaluated and fired until the end of the bar on which the entry order stop or limit was actually filled. 

Additionally, if your protective stop or exit uses the entry price indicator or any indicator requiring entry info, then even with a market order entry, the stop calculations will not be evaluated and fired until the end of the bar on which the actual entry fill price occurs and is therefore available for use in the calculation.

Appendix B – NeuroShell Color Schemes During Integrated Trading

NeuroShell Trader uses the following color schemes to distinguish whether integrated trading has just started, is proceeding normally or is ending:

a. Army Green on chart and green in alerts and order window means that active trading was just turned on and it is waiting to place an entry order. No position closing exit orders will be placed with the brokerage, only an entry order to open the position.

b. Bright Yellow on chart and green in alerts and order window means that the first entry order was placed on that bar or a previous bar, but an entry fill did not yet occur on that bar.

c. Light pale yellow on the chart and black in the alerts and orders window means that active trading is occurring, both entry and exit orders will be placed with the brokerage.

d. When you turn off active trading, the chart goes to bright yellow again and the alerts and orders window shows red, meaning that trading is ending and no new entry orders will be placed with the brokerage, only an exit order to close out the existing position.

e. If you are actively trading a chart, save and close that chart, but then reload the chart later, the bars between when you closed the chart and opened the chart will be colored purple. NeuroShell will not signal any trade entries, exits or stops during the purple colored time period because the chart was closed, but still being actively traded.

Appendix C – Dr Ted’s view of Integrated Trading FX with IB

Currency Trading, NeuroShell, eSignal, and Interactive Brokers
Dr. Ted Achacoso
December 15, 2006 (rev. 12/21/06)
 
I.                   The Currency Dealer or Broker
Unlike in equities trading where there is a centralized exchange, currency trading is decentralized, and effectively, your dealer or broker is your exchange. Understanding this is crucial to your currency trading, your data source, and your modeling in NeuroShell. There are two ways of classifying currency dealers or brokers as relevant to modeling and automated trading:
A.     Liquidity Providers
There are two types of brokers based on their liquidity providers:
1)      The more common market maker-type broker is its own liquidity provider. This means that the broker himself will transact your position, that is, the dealer will directly take the position against yours. If you are buying, he will sell, and if you are selling, he will buy from you. He then re-transacts the positions out to his affiliated banks (at an additional profit). For this type of dealer, you will pay only the spread.
2)      The less common ECN-type broker simply posts the bid/ask spread, and your order is seen and transacted directly by his affiliated banks who are his real liquidity providers (In fact, you can demand from an ECN-type broker his list of liquidity providers). He does not take positions against you. For this type of dealer, you pay the both spread (which goes to the bank) and the commission (which goes to the dealer).  An ECN-type dealer usually requires a higher margin deposit than a market-maker type mainly because you are dealing directly with large, reputable banks.
Interactive Brokers is an ECN-type broker.
B.	Exclusivity 
There are two types of brokers based on their exclusivity in trading currencies:
1)      The more common exclusive type allows only trading of currencies, and occasionally, precious metals such as gold. Their software client interfaces are usually easier to use since you are dealing with them directly. They usually offer many more currency pairs to trade. In order to automate trading, they have their proprietary APIs that are either free or rented out for a fee (which can then be recouped by exceeding monthly transaction limits).
2)      The less-common comprehensive type allows trading of many financial instruments other than currencies. Although their software client interfaces are easy for equities, most of their currency trading programs are retrofitted from equities. They will have a name for their own exchange (remember that this exchange is seen only by them and not by other brokers) and will tend to trade less currencies. Their APIs are usually free since they are commission-based.
Interactive Brokers is a comprehensive-type broker. The name of its currency-trading exchange is IDEALPRO and the name of its software client interface is TWS.
II.                Currency Trading
Trading currencies is like exchanging money for foreign travel. For example, a Japanese from Tokyo will exchange his Yen for some Euro before heading out to tour Paris. Therefore, unlike equities, currencies are traded in pairs with one long position (buying Euro) and one short position (selling Yen) at the same time. The tourist may do this in a foreign exchange booth (market maker-type dealer) or in a bank (ECN-type dealer).
A.	Data Issues 
1. Indicative Data: Since currency trading is decentralized, the data you get from eSignal will be indicative data, meaning, these are data or averages of data from as many banks that provide them with data. You must be mindful of this when modeling using NeuroShell, since very short timeframes are very sensitive to actual data. There are some brokers that will provide data in real-time, sometimes for free, sometimes for a fee.
2. Level II:  Being decentralized, currency data as provided by eSignal has no volume, and the volume appearing in the data stream is actually the number of transactions for that time bar (not the size of the transactions) from eSignal data feeders. Note that ECN-type brokers usually provide a Level-II type screen where you can see the actual volume of transactions. The only way to access this broker-specific volume for use in NeuroShell is to use their API, if they allow access to these data.
3. 24-Hour Data: Currency trading is a 24-by-6 activity, starting in Sydney, then proceeding to Tokyo, London, and US. Each will have a currency market open that is different from the equities market open. So, when does a day begin? The answer, for most brokers, is the time the banks reset their servers, usually at 5PM EST. This time is usually posted on the broker’s website. eSignal‘s day always begins at 14:00 PST or 15:00 PDT, and opens the week at 9AM PT on Sundays. NeuroShell already takes this into account for the eSignal data stream.
B.	Modeling Issues 
1. Home Currency:  In the Japanese tourist example above, it is clear that his home currency is the Yen. In currency trading, the monetary denomination of the account that you are trading is called the home currency or account currency. There are brokers who will allow you to create several sub-accounts with different currency denominations.
Interactive Brokers uses the non-conventional term “Underlying” to signify your home currency or your account currency.
2. Lots:  In currency trading, a standard lot is 100K and a mini-lot is 10K. These are almost passé now, and with automation, variable lots are now the norm. Although some market maker-type dealers will allow you to trade a few dollars at the time, ECN-types will usually require a minimum, after which you can do variable lot sizing.
Interactive Brokers requires a different minimum trade size per currency pair offered for trading. You should check the minimum trade size before trading any currencies in IB. If you submit orders below this minimum size, you will usually, but not always, get an Order Size pop-up error message back from Interactive Brokers after the order is placed. Variable lot sizing can then be used beyond the minimum.
3. Currency Pairs:  Currencies not paired with the USD are nicknamed “crosses”. The Japanese tourist example deals with the EUR/JPY cross pair, a direct conversion of Yen to Euro without any intervening conversion of either currency into USD rates, i.e., EUR/USD and USD/JPY. This is called a “true” cross. When a dealer does not offer a currency pair of choice, once can create what is called a “synthetic” cross pair, where conversion to USD rates are used. In the example above, if EURJPY were not offered by the broker, a simultaneous transaction of EUR/USD and USD/JPY can be done. This effectively doubles the spread as well, in addition to commissions, if any.
Interactive Brokers treats crosses as synthetic pairs by splitting them up into their major (USD paired) components. When you place an order of EUR/JPY in IB, for example, IB will automatically split it into two orders, one for EUR/USD and the other for USD/JPY. This has critical consequences in creating NeuroShell models, especially those that are based solely on true EUR/JPY cross data. Spreads are doubled, in addition to the commission, so these increased fees have to be factored into the model as well.
4. Client Software Interface:  Even before attempting to connect any dealer interface with NeuroShell, practice with the dealer’s client software interface is essential. For example, some clients will allow you to do a one-click simultaneous selling of Yen and buying of Euro in a USD home account. Others, like Interactive Brokers, are more involved. The following examples from Interactive Broker’s website should help you understand trading FOREX with Interactive Brokers:
*****
a. Example 1 
If you want to buy/sell a specific amount of GBP, first enter the symbol GBP as the transaction currency. Then choose USD as the settlement currency from the drop down menu. You will then receive the quote USD.GBP, e.g., Bid: 1.5300 Ask: 1.5310. This means that GBP 1 = US$1.53XX.
If you want to buy GBP 10,000, click on the Ask and enter 10,000 as the quantity of GBP that you wish to buy. You will pay $1.5300 for each GBP. Thus, you will pay $15,310.
If you want to sell GBP 10,000, click on the Bid and enter 10,000 as the quantity of GBP that you wish to sell. You will receive $1.5300 for each GBP. Thus, you will receive $15,300.
b. Example 2 
If you want to buy/sell a specific amount of USD, first enter the symbol USD as the transaction currency. Then choose GBP as the settlement currency from the 
drop down menu. You will then receive the quote GBP.USD, e.g., Bid: 0.6530 Ask: 0.6536. This means that USD 1 = GBP 0.653XX
If you want to buy USD 10,000, click on the Ask and enter 10,000 as the quantity of USD that you wish to buy. You will pay GBP 0.6536 for each USD. Thus, you 
will pay GBP 6,536.
If you want to sell USD 10,000, click on the Bid and enter 10,000 as the quantity of USD that you wish to sell. You will receive GBP 0.6530 for each USD. 
Thus, you will receive GBP 6,530.
*****
Closing the EUR/JPY the previous example above and reconverting everything to a USD home account may come as a single button called “Close Position.” Others, like Interactive Brokers, will be more involved. In IB, if you bought EUR and sold JPY and would now like to close the trade (in a USD account), you will have to re-sell the EURUSD and repurchase the USDJPY at the correct amounts. Since rates are always moving, there will be some unconverted bits and pieces of Euro and Yen which need to be reconverted to USD via another manual mechanism.
 
5. Using NeuroShell
a.       Addressing Variable Denomination of Home Accounts: 

1) The Pip-Based Model: Given that NeuroShell can be used to model many account currency denominations, the key to simplifying NeuroShell model-making in currency trading is to treat $1 as 1 pip. This way, all models are pip-based rather than currency denomination-based. 
This is easily done by setting 2 boxes in the “Other Costs” in the “Cost” tab. “Margin $ per unit” is set to $1.00 and “Point values for futures, forex, etc.” should reflect the conversion of the price of a currency pair to one pip. Since a pip is the smallest tradable increment that a currency pair can move, all pairs with 4 significant digits (those pairs that are not crossed with JPY) should have a point value of 10000, and all pairs paired with 2 significant digits (those pairs that are crossed with JPY) should have a point value of 100. This way, in all profit columns of the model, the $1 is actually 1 pip and not 1 USD. EUR/JPY, for example, will have a point value of 100, meaning, all changes in EUR/JPY price have to be multiplied by 100. If the price were 155.45 and moved to 155.50, then the change is 5 pips, already reflected in the model as such, and not as.05 Yen. Do not forget to factor in the spread and any commissions, which are also expressed in pips or percentage of a pip. 
Using this technique, models become quickly adaptable to other home or sub-account currencies, since many currency traders use more than one broker and more than one home currency. It also makes sense when you try to optimize across all chart pages in NeuroShell, because all the profits and losses are expressed in the same unit: pips.
2) The Currency Denomination-Based Model: Should you decide not to use the easier pip-based model for whatever reason, remember that NeuroShell Trader was originally designed to trade U.S. stocks and U.S. futures, long before FOREX trading became easily accessible and popular. As a result, NeuroShell Trader assumes a settlement currency of USD ($). As described below, this can cause some confusion when trading a FOREX currency pair in which the settlement currency (home currency) is not USD.
Trading Strategies in NeuroShell Trader provide you with the following options:
Buy a fixed number of units -> ___ Units 
Buy a fixed amount of units -> ___ Dollars
Buy as many units as possible with current account balance -> ___ Dollars
For buying a fixed number of units, the number of units equates to the transaction currency. As described above, if you are trading USD.EUR, an order size of 50,000 units is an order for 50,000 Euro. Likewise, if you are trading EUR.USD, an order size of 50,000 units is an order for $50,000.
However, because NeuroShell Trader assumes a settlement currency of USD, the latter two options will only make sense if you trade FOREX symbols of the form USD.XXX. For instance, trading a $50,000 amount of the currency pair USD.GBP, which is currently quoted at 1.5310, would result in trading 32,658 units (i.e., GBP).
If you trade a currency like JPY.EUR, then the fixed amount is actually in Yen instead of Dollars as it is labeled, and the account balance is actually in Yen and not Dollars as it is labeled. Likewise, a currency pair of EUR.JPY would mean that the fixed amount is actually in Euro instead of Dollars, and the account balance is actually in Euro and not Dollars. For instance, trading a 50,000 amount of the currency pair EUR.JPY, which is currently quoted at 0.006440, would result in trading 7,763,975 units (i.e., Yen).
Because NeuroShell Trader assumes a settlement currency of $, all of the statistics like profit and drawdown are labeled as $XXX,XXX.xx. However, as above, if you are trading a currency pair like JPY.EUR, the statistics will actually be in Yen, even though NeuroShell Trader labels them as $. Like wise a currency pair of EUR.JPY would result in statistics that are actually Euro, even though they are labeled as $.
Although all of the above may be simple to understand when analyzing one currency pair, keep in mind that NeuroShell Trader allows trading strategies to be applied across multiple chart pages (for example EUR.USD, JPY.GBP). The result is that using fixed amount and account balance trading may not result in balanced trading amounts as each chart page is in the settlement currency (in the EUR.USD, JPY.GBP example, trading an amount of 50,000 would not be balanced because obviously 50,000 Euro is a lot different size than 50,000 Yen). Likewise, comparison of statistics across chart pages will not make much sense as each is in a different transaction currency (in the EUR.USD, JPY.GBP example one chart page is showing profit in Euro and the other is showing profit in Yen).
And this is why a pip-based model makes more sense. Besides, profits in currency trading are really expressed in pips.
b.      Addressing Variable Lot Sizing: You can take advantage of variable lot sizing manually at trading run-time. Most brokers are moving away from fixed lots, and the key to simplifying lot sizing is to base the calculations on the number of units of currency to be traded and not the actual leveraged monetary value of the trade. Remember that a currency pair is composed of the BASE currency/QUOTE currency, and the account from which you are trading is your HOME currency. The formula to calculate the number of units available for you to trade is:
Margin Available * (margin ratio) / ({BASE}/HOME Currency} Exchange Rate)
For example, if the HOME Currency is USD,  and the currency pair you wish to trade is GBP/CHF,  and if you had $100 in the account with a margin ratio (leverage) of 20:1, then lookup the current BASE/HOME Currency Exchange Rate for GBP/USD (say 1.584). Units = (100*20)/1.584 = 1262 units available to trade. You can trade all of these, or less.
C.	Currency Trading Automation
1.      During model-making, you should set NeuroShell’s lot size to 1. This has to be changed at trading run-time, however. When using the automated bridge from NeuroShell, Interactive Brokers picks up lot size from NeuroShell as the number of units to be traded, so you have to set this according to your money management plan using the unit computations given above. Since this is not yet automated, and currency exchange rates are continuously changing, you will have to do this manually. After setting the lot size, NeuroShell will want to reoptimize. Cancel the optimization to preserve the signals of a pip-based model. When trading automatically, make sure that you are still trading your desired number of units by monitoring the BASE/HOME rates. If not, adjust accordingly.
2.      A standard interface to bridge currency brokers and other software such as NeuroShell is still at its nascent stage. Even if completed, it will take a while to migrate the currently offered proprietary APIs of currency brokers to the standardized format. For now, the only recourse for full automation is to use the API provided by your broker, if they have one.
3.      If you are using the IB bridge from NeuroShell, you may never see a EUR/JPY order, even if everything is correctly mapped from eSignal, and everything is working correctly. This is because IB splits the order, as discussed earlier. In TWS all you may see are two separate orders, one for EUR/USD, and the other for EUR/JPY. NeuroShell, however, records the order correctly.

Appendix D – Removing the wrong API

The following message should appear if you have an incompatible IB API installed. Even if it does not appear, but you know you have installed the IB API yourself, follow the instructions below. If you are unable to follow the directions below, please contact technical support for assistance.

The currently installed and registered Interactive Brokers API is not compatible with this version of NeuroShell Trader.  To restore the compatible Interactive Brokers API which is automatically installed with NeuroShell Trader: 

1) Uninstall the 'TWS Interoperability Components' using Add/Remove Programs from Windows Control Panel. 
2) Uninstall NeuroShell Trader 
3) Erase the files Tws.OCX and TwsSocketClient.DLL from C:\Windows\System32 
4) Reinstall NeuroShell Trader 
5) If necessary, reinstall Interactive Brokers Trader Workstation.  However, DO NOT REINSTALL any Interactive Brokers APIs! 

Appendix E – Finding the correct IB symbol

The symbols Interactive Brokers uses are often not the same one your data feed uses, especially if you are trading something other than stocks. Often the exchange is different too. Therefore, when you set up automatic trading, you need to "map" the data feed symbol to the IB symbol. In other words, NeuroShell translates the symbol for you when it places a trade. However, it is sometimes difficult to find out exactly what to tell NeuroShell to translate too. 

For example, suppose you want to trade E-mini Dow futures, whose symbol is YM and it is on the CBOT Exchange. If you want the December 2006 contract, you would choose YMZ6 on most data feeds. That doesn't work with IB, unfortunately, so you'd have to set up a mapping in NeuroShell (Tools -> Options -> Trading Orders -> Ticker & Exchange Mapping...)

But what should it be mapped to? The key to the correct symbol and exchange discovery is in the IB Trader Workstation (TWS). The first thing you have to do is insert the symbol there. The default way is to insert YM in the "Underlying column" and then press the enter key to get a dialog going to let you choose that you want Futures and the December 2006 USD contract. When you are done you do see that the exchange is ECBOT (the electronic CBOT), but all you see for the symbol is YM.

You can clarify things a little by going to the TWS View menu and select "Symbol Mode" instead of "underlying mode". Now you can see the correct symbol which is "YM DEC 06". 

But wait! How many spaces are between YM and DEC and how many between DEC and 06? Turns out IB wants that to be exactly right. When we looked we thought there were two and one respectively. We never dreamed there were THREE spaces between YM and DEC, but there are, and you need all three to make IB happy!

There is a quick way you can make sure you have the right symbol before you put it in NeuroShell's mapping. While still in Symbol Mode, go to the Ticker Menu and select "Add Symbol" . If you can get the symbol accepted by TWS there, then TWS will accept that symbol when NeuroShell sends it.

In the end we had to email IB tech support to find out there were three spaces, because we never dreamed we'd have to enter more than two! So the correct symbol is YMbbbDECb06 where each b is a blank space. If you have to email IB like we did, just tell them you are having trouble getting the symbol accepted in their Ticker -> Add Symbol dialog. If you mention NeuroShell, they will just assume it is a NeuroShell problem.

Here's another example. To find out all the possible option symbols for Interactive Brokers, when running the Interactive Broker’s Traders Workstation, choose “Lookup Symbol…” from the Ticker menu. If you then enter say “Russell 2000” and CBOE and ALL contract types, you’ll see a listing of every ticker symbol related to the Russell 2000 including emini futures, futures, options, etc. To see all the Russell 2000 options ticker symbols, select the “Show all contracts” link next to the Russell 2000 options listing.

The following is a link to IB which shows the Forex symbols they use:

http://individuals.interactivebrokers.com/en/trading/exchanges.php?exch=ibfxpro&showcategories=FX&ib_entity=llc

Be sure to set the exchange to "Idealpro", and the type to "cash" when mapping symbols from the data feed for integrated trading with IB.

PS - As of release 5.4, NeuroShell will tell you the symbol is not recognized by IB if you have not enabled the API in TWS (Configure->API->Enable ActiveX and Socket Clients). So if you are having trouble getting a correct symbol recognized, enable the API, then reboot NeuroShell.