[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Faking a Limit Order on Current Bar



PureBytes Links

Trading Reference Links

> Maybe I could have the 1-minute bars in data2 and pure ticks in
> data1? 

Yes, you could do that.  Use the 1min bars to do your 
calculations, assuming you need to do that.  Your system will get 
called on every tick, so you can act as fast as you need to.

> I recall seeing here a while back where you could specify something like
>  "if next bar high > next bar value1 then buy at xx limit"
> which would wait until the necessary data came up to execute the
> limit order on the next bar, which by then would be the current bar.

No, I think you can only look at the OPEN of the next bar.  It's 
already a bit dicey to look at the next bar's open, which is why 
TS blocks certain operations.  (Like "if open of next bar > close 
then buy at close; sell at market")  Looking at the high, low, or 
close is looking too far into the future, by that logic.  You're 
too likely to do something you couldn't do in realtime.

Why wait until the data comes up?  Just issue the order on every 
bar until it's filled or cancelled.  Or, since you're going to do 
it on a 1tick chart anyway, who cares about limit orders?  You 
can do it yourself with market orders.  When Close < LimitBuy 
then buy, when Close > LimitSell then sell.

Gary