Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I recommend issuing orders at the bid/ask and applying some sort of momentum cushion.
In high velocity markets, your limit order can get skipped if you try to issue at an open price.
inputs: pricegap(.01);
If (entry criteria) then buy next bar at currentask + pricegap;
If (entry criteria) then sellshort next bar at currentbid - pricegap;
etc.
you can also make pricegap a variable that adjusts according to the market volitility/velocity. In higher velocity markets, it can be larger and it slow markets, you can have it converge to zero.
Also, with tradestation, limit order does not equal "limit if touched."
They make it really complicated, so you should research on MC to ensure that the two are analogous.
A limit if touched order only gets issued if the price is touched. A limit order gets submitted immediately.
The difference might seem trivial, but it's relevant when trying to implement additional risk management.
TS limits orders from being issued more frequently than 15 seconds apart. Anything beyond 15 seconds, TS will maintain the order on their stop server. If you violate the 15 second rule, the order will be maintained on your machine. In the event that your machine crashes or loses connection, orders that are not maintained at the stopserver will not be valid.
You should verify with MC if there are similar limitations.
Obviously, depending on your trading style, risk tolerance, money management, trading hours, etc, one or the other might be preferable.
"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
Great post thats exactly what I was getting at with your suggestion of pricegap in my first post, point 2.
Also using currentask and currentbid seems better.
Say you've got a chart that is set to bid and you issue a limit order based on the current bid price I'm guessing its going to get missed straight away as the ask price will be higher by what ever the spread is...
If you're issuing on the momentum side, just be aware that your pricegap is slippage, just in deliberate form.
In a sense, you're avoiding slippage from market orders, but at the cost of the pricegap. This type of approach is mainly needed once your order sizes start getting large enough to see more than a tick of slippage.
If you're trading during high volume periods, on liquid instruments, this will usually mean some pretty large orders before the limit approach is necessary.
If you're trading off hours, then this approach will be necessary earlier (or with smaller positions).
Also know that limit order execution complicates matters, as you have the issues associated with partial fills.
The good thing is that momentum (or windward) side orders, partial fills are a good thing. A partial fill on an entry, means the market partially filled you and then moved against you, so you entered a smaller position on a loss. A partial fill on profitable exit means you didn't get "limited out" and the trade continues in your favor. A partial fill on loss exit means you survived to fight some more.
Bear in mind that TS has some settings associated with limit orders and partial fills. You need to check and ensure you're on top of MC's settings. You can set it to automatically convert to a market order after a certain amount of time, you can cancel the remaining order if price moves away, etc.
Also, bear in mind that momentum side limit orders still exhibit slippage. I call it momentum slippage. Essentially, the order gets translated from your platform, to the broker, then to the exchange. If you issue the order to the broker at say $0.00 (a buy order on an upward trend). During high velocity market conditions, the price may have moved by the time the broker was able to issue the order to the exchange. So your order may actually get filled at some price higher than $0.00. This is called momentume slippage and it hurts you on momentum side entries and exits.
So keep all this in mind with your limit strategies. Generally, limit orders are necessary (and all the headaches) for larger positions. If you're trading a small position, it's almost always better to just bite the bullet and go with market orders.
Simulation cannot accurately account for variances you'll see with either approach. Sim cannot adequately calculate market order slippage (although you can place the settings to only fill once price has moved at least a tick beyond your order). It also cannot account for live limit slippage (that I covered above).
So you'll see some variance from sim to live. You need to ensure that your net profit/trade is adequate enough to suffer SOME amount of platform-broker-exchange lag (momentum slippage).
I generally backtest with commission plus a tick on each side (for my pricegap) and then if my performance is still satisfactory if I add another tick on each side (for platform lag) then it's tough enough to think about taking live.
If you're strategy with commissions, doesn't yield more than 4 or 5 ticks per trade (net), I'd be very wary about putting any more time or energy into it....as even a small amount of platform variance can really ruin your day. At least it totally wrecks your drawdown, at worst it can totally ruin your profitability.
"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
I have come to the conclusion that proper simulation of real time trading means using at least the OPEN of the next bar as the closing price of the prior bar, especially when trading at even intervals of time like 5 minute or 30 minute bars, if not many ticks of delay as proxy for the close of the prior bar. You want YOUR strategy bar close to sync up with its arrival at your counterparty's bid or offer.
Experiment: Take any strategy that allows trades to commence at the daily open, (regular Session).
Compare results of that same strategy using a custom Session starting time whose intervals are displaced just ONE minute later or earlier in time by starting the Session a minute early or late. Same trick may show difference at the daily Close.
I sometimes see multi-tick gaps between 1 minute bars prior bar close and next bar open. Right where I get signals....and the market leaps.... These little details need to be taken into your strategy's thoughtful consideration along with transmission and computer latency and positioning in limit order book queue.
Mike in red below you said that all orders are canceled and replaced at the start of each new bar. But I dont see it happend way. For example i have coded a breakout strategy to take the break of an inside bar high + 1 tick. If my condition is met the pending order is placed. However if the price never touches the price the pending order is still there for hours which I only want the pending order to be there for one hour. How do I get it to be there so its not there indefinetly?
my time frame is a 1 hour chart and the code is below
vars:mystoploss(0);
condition1= h<h[1] and l>l[1];
if marketposition = 0 and condition1 then
buy ("IB Break") 1 contracts next bar at h+1 point or higher;
setprofittarget(500);
setstoploss(500);
I get the same results when backtesting. It works fine on backtesting. Its on live mode that you will see once the condition is true it will but the stop pending orders in. Once the stop pending orders are put in they will remain there indefinetely until one of two things happen. 1. the signal gets executed or 2. There is a new signal.
So for example at 5am if we get a true condition then at beginning of hour 6 the orders are in place pending at h+1. If it doesnt get executed they still stay there even if 4 hours have passed by.