hi
I have one order (buy next bar at 100 stop;)
I want that order to be the same(active) for the next 5 bars in backingteste
any suggestion
thanks
limit order for nexts bars
- Andrew Kirillov
- Posts: 1589
- Joined: 28 Jul 2005
- Has thanked: 2 times
- Been thanked: 31 times
- Contact:
Andrew.
Due to all our talks about limit orders, that you are currently implementing...
I think, that we should have two kind of orders:
- First is how it works now, thus MC is holding within itself until limit hits and than executes as market.
- Second, really limit orders.
We need still have first ("MC") limit orders to work with all indicators, that have like 'Buy next bar at price limit' that could be hold during many bars and we do not want to really send all this Technical ! orders to exchange.
So, we need to somehow separate MC orders from Real orders....
What do you think?
Due to all our talks about limit orders, that you are currently implementing...
I think, that we should have two kind of orders:
- First is how it works now, thus MC is holding within itself until limit hits and than executes as market.
- Second, really limit orders.
We need still have first ("MC") limit orders to work with all indicators, that have like 'Buy next bar at price limit' that could be hold during many bars and we do not want to really send all this Technical ! orders to exchange.
So, we need to somehow separate MC orders from Real orders....
What do you think?
- Stanley Miller
- Posts: 556
- Joined: 26 Jul 2005
- Has thanked: 3 times
Victor,
The orders sent to the broker to be executed and orders that a strategy uses to calculate points of entry and exit are different.
Everything written above concerns backtesting signals' operation logic. The limit and stop orders operate the way they should and the strategy determines points of entry and exit on this basis.
If we talk about automatic order execution then currently we just send a market order at the moment when the arrow appears on the chart. We did this because it is relatively easy to implement and it suits 80% or 90% of users. We would need to implement a far more complex algorithm in order to support real limit and stop orders. Depending on the strategy's logic in certain cases we would need to place up to a dozen of orders simultaneously and trace them in each new bar.
The orders sent to the broker to be executed and orders that a strategy uses to calculate points of entry and exit are different.
Everything written above concerns backtesting signals' operation logic. The limit and stop orders operate the way they should and the strategy determines points of entry and exit on this basis.
If we talk about automatic order execution then currently we just send a market order at the moment when the arrow appears on the chart. We did this because it is relatively easy to implement and it suits 80% or 90% of users. We would need to implement a far more complex algorithm in order to support real limit and stop orders. Depending on the strategy's logic in certain cases we would need to place up to a dozen of orders simultaneously and trace them in each new bar.
Stanley, I agree. Either you just shoot off the market orders as you have now and put up witgh the slippage (which makes many day trading strategies unprofitable) or alternatively, create a very intelligent and aware autotrader that requires more complex programming to avoid slippage and to avoid the biggest problem, the system getting out of synch with the broker. This last problem happens quite a lot unless the autotrader is very aware.
I, for one, would rather you use your resources on more important, to me, issues, most of which have been aired in this forum.
I, for one, would rather you use your resources on more important, to me, issues, most of which have been aired in this forum.
- Stanley Miller
- Posts: 556
- Joined: 26 Jul 2005
- Has thanked: 3 times
Thank you for the understanding. We chose such logic because this approach is much easier to implement and it doesn’t lead to a considerable complication of the execution logic and therefore doesn't have a number of potential problems and bugs. At the same time according to our tests IB executes market orders virtually instantly and there's no big difference in the final result. This suits most of our users and we can concentrate on other very important features.