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?
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.
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?
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.
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.
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.