Click here to Login





                                                   Exit rules - Simulation vs actual trades

  0

0
GS
2012-10-23 03:12:35


Hi,

During back testing I have three conditions for the exit:

A) Stop loss - X% B) Profit stop - Y% and C) N-Bar stop

When we actually trade, what is that "single" order type which is close to this situation. In Interactive Brokers there is something like "bracket order", in that we can give "Stop Loss" and "Profit stop" orders in one go. What about "N-Bar Stop". Also I would like to understand how these orders are actually executed during the simulation? For example if price is gone below "Stop Loss" within a bar, will it be triggered immediately or it will wait till the next bar? Also, the same doubt I have about profit stop.

Within optimization I could see "Stop profit" and "Stop profit value", how these two are different? Similarly how "Stop N-Bar" and "Stop N-Bar value" are different?

While simulating the strategy, I can see drawdown, in general its value is much higher as compared to the max %loss for a given trade, why so? And how do I see where this max drawdown occurred?

Thanks



QuantShare
2012-10-23 18:24:43

  0

The different stop orders will be associated with each trade.
The simulator executes stop orders by looking first at Stop Loss then Stop Profit then Trailing Stop then N-Bar Stop.

When a stop is hit the default order specified in the simulation is used. The order is sent on the bar the stop was hit and execute today or tomorrow based on the default order settings.

You can execute order immediately (intraday) by using "Update Trading System -> Settings -> Capital -> Activate Stop Immediately".

The drawdown is the the peak-to-trough decline during the simulation. You can see where the maximum drawdown occurred by plotting the drawdown series. In Simulation Report, choose "Drawdown" next to "Select a time-series to drag and drop...". Click on "Drag" then drop the time-series into the simulation report chart. You can create a new pane in that chart by right clicking on it.




Vangelis M.
2012-10-24 00:20:12

  0

Note regarding live execution in IB: One way to mimic the NBar rule is to attach an extra Date/Time-based order in the profit/Loss OCO set of orders.



GS
2012-10-24 03:27:50

  0

Thank you Vangelis for your suggestion, below is the link for various order types available with IB:

http://www.interactivebrokers.co.in/en/p.php?f=orderTypesIN&ib_entity=in
http://www.interactivebrokers.co.in/en/trading/orders/oca.php?ib_entity=in

I think you meant OCA (One Cancels All), and for now this might be the best way to actually implement "N-Bar stop" while trading live, and looks like only IB is providing this facility. To make it more clear, first use "Bracket" order, and link it to a group created for OCA. Within OCA we need to use Date/Time based order. If any one in this forum has already used such procedure, I request you to please add your valuable comments.

Also, in future when we will be able to use QuantShare for automated trading, how these three exit rules will be implemented and executed for live trading?



QuantShare
2012-10-24 11:33:15

  0

We have not scheduled yet the release of the automated trading version.
These stop orders will be simulated by QuantShare. When a stop is met, QS automatically send the order to IB.



Vangelis M.
2012-10-25 16:49:40

  0

Yes, I did mean OCA (one cancels all). Thank you for the correction.
It seems there are two ways to do it:

1.Have QS keep track of the stop and profit levels and issue orders when these are reached.
Disadvantages:
a. If the internet connection fails, so does the stop loss...
Advantages:
a. Simpler to manage the code.
b. The market does not know where our stop sits.

2. Submit 2 to 4 orders (Entry,StopLoss,ProfitTake,nbars) by attaching the same OCA code.
Disadvantages:
a. It becomes complicated to keep track of all these orders and be able to adjust them, especially if one intervenes manually.
a. The market can "see" the sitting stop/profit orders.
Advantages:
a. The trade is "bracketed and protected" even when if QS is disconnected (i.e., ISP or other internet disconnection).
b. Some trading styles would require bracketed orders:
For example I might choose to issue 100 limit orders at each stock yesterday's price-5%, with stoploss at 1% and profit at 0.5%.
Issuing OCA bracketed orders would make this trade very simple to execute.

I think having QS keep track of stops and issuing orders is better and simpler as well as more "private". This behavior could be the default.
For those that want to custom code everything there should be a way to program custom OCA orders and submit them to IB.

Thanks



No more messages
0




Reply:

No html code. URLs turn into links automatically.

Type in the trading objects you want to include: - Add Objects
To add a trading object in your message, type in the object name, select it and then click on "Add Objects"










QuantShare

Trading Items
Short Cover Simulation Indicator
Buy Sell Simulation Indicator
Vary the Start Date of a Trading System Simulation
Entry Price and Exit Price in Trading System Report
Adaptive Trading Indicator based on the Return of Past Trades

How-to Lessons
How to add a metric in the trading system simulation report
How to create a Monte Carlo simulation
How to add trades from one portfolio to another one
How to create trading rules based on Put and Call volume data
How to import trades into a portfolio

Related Forum Threads
Analysis tab in simulation report - group by Exit Rule
Adjust the Entry and exit prices of trades in AMM script
no trades in simulation
Report simulation performance by symbol?
Graph trades

Blog Posts
Forecast volatility using trading rules and neural networks
True portfolio simulation applied to trading systems
How to use date components in your trading rules
Introduction to the trading rules analyzer
Trading System: Moving average crossover and few others buy and s...









QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2024 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items



Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.