RightEdge - The Ultimate Backtesting and Trading System Development Platform

Simulated Broker Settings

After configuring a simulated or "paper trade" broker it is possible to configure various settings which affect how orders are filled. To do this, display the Paper Trader Settings dialog by selecting Configure Services... from the Tools menu and selecting the Paper Broker in the list.

Note: If you do not see the Paper Broker in the list of services, please refer to the Configuring Services section.

Click the Modify... button, followed by the Other Settings... button.

PaperTraderSettings

Commissions

The Paper Broker that ships with RightEdge supports some of the common types of commission calculations.  In the screenshot above, the broker charges 1/2 penny per share up to $20.00.  At the least, the broker will charge $1.00 for the trade if the 1/2 penny increment does not total $1.00.  Many other brokerage houses offer a flat trade per side regardless of the size.  For this case, set the Flat Commission per Trade value and set all of the other values to 0.

Account Margin Factor

This setting controls the account-wide margin factor (also known as leverage).  If this is set to 1, then the buying power will be equivalent to the amount of cash in the account.  If it is set to higher than 1, then the account will behave as a margin account with the specified margin factor.  For example, a setting of 2 will allow purchasing instruments with an entry cost of twice the account value.

Use bid and ask prices to calculate fills, if available

This option allows you to more accurately simulate fills using bid and ask values. This may be especially useful if you are trading with a Forex broker that sets the bid / ask spread instead of charging commissions per trade.

To use this option, the bid and ask prices for the bar should be the bid and ask prices at the close of the bar. If the bid and ask are zero, it will use the normal prices. If they are nonzero, it will use the difference between the close and the bid and ask to calculate bid and ask values for the OHLC values. The bid values will be used for sell transactions, and the ask values will be used for buy transactions.

Require Interest Rates for Forex Trading

If this option is enabled, then the broker will generate an error if interest rate data is not available when interest would be applied to an open Forex position.  If the option is disabled, then the broker will simply continue without applying the Forex interest.  See also the "Apply Interest to open Forex Positions" and "Forex Rollover Time" settings in the RightEdge Options.

Allow Position Reversal

If this option is enabled, the broker will allow a sell or a cover order which is larger than the current position size to be filled. A new position will be opened in the opposite direction with the "left over" shares. For example, if you are long 100 shares of a given symbol, you could submit an order to sell 200. The 100 shares you have would be sold, and then the remaining 100 shares would be shorted, leaving your final position at short 200 shares.

Note that if you do this, you will need to change the PositionManager.PositionOverfilledAction or handle the PositionManager.PositionOverfilled event. Otherwise the position manager will throw an exception (which will stop your system execution) when the order is filled. See the developer documentation for more information.

See Also

Run Backtest/Simulation

Configuring a Simulated Broker

Configuring Services

Modifying Services

Removing Services