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

Re: LOOK inside Bar order entry


  • To: "Michael King" <mrking@xxxxxxxx>
  • Subject: Re: LOOK inside Bar order entry
  • From: "Gary Fritz" <fritz@xxxxxxxx>
  • Date: Wed, 08 Sep 2004 21:14:23 -0600
  • Priority: normal

PureBytes Links

Trading Reference Links

> It seems no one here has an answer to my QUESTION , and I thank you
> all for responding. 

Several people have answered your question, correctly, but you 
seem unwilling to accept the answer.

Tradestation executes its systems at the CLOSE of a bar.  That is 
how the product is defined.  Since the system doesn't execute 
until the bar has already closed, it can't do anything during the 
middle of the bar -- that time has already passed.

Could someone write a magic DLL that does this for you?  
Conceivably, but I doubt it.  It's not just a matter of doing 
something that TS happens to not do; you're trying to circumvent 
a basic definition of how systems work.  I suspect you would run 
into a lot of problems and inconsistencies if you managed to do 
it.

And it's not necessary.  There are several ways around the 
problem.

The simplest and best solution to this is, as several suggested, 
to use shorter bars.  Calculate the key values as often as you 
want, and you can act almost immediately when your condition 
happens.  (Immediately, if you do it in a 1 tick chart.)  If 1min 
resolution is good enough for you, you can run your system on 
1min data in data1.  If you don't want to or can't compute your 
longer-timeframe data (say, RSI of a 60min bar) in a 1min 
timeframe, you can add 60min bars to your chart in data2 and 
compute RSI on those bars.  There are subtleties and gotchas 
about using multiple data streams but it's not terribly hard.  If 
1min resolution isn't good enough, you'll have to use a tick 
chart, and you can't add another data series to a tick chart.  
You'd have to do all your calculations in the tick chart, or run 
a parallel chart with your desired timeframe and communicate 
calculations via global vars.  Again, possible but messy.

Another option is to predetermine what prices trigger your 
intrabar signal condition, as Alex and Gabriel suggested.  TS's 
definition says you must issue orders on bar X for execution on 
bar X+1.  So if you can figure out, at the close of bar X, what 
price in bar X+1 would trigger your signal, you can issue a 
stop/limit order for that price at the close of bar X.

There are other possibilities, but those are the best.  They will 
work to solve your problem just fine.  Why do you insist on a 
solution that doesn't exist, when there are simple options that 
DO exist?

Gary