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

Re: Recognising a new month starting



PureBytes Links

Trading Reference Links

At 06:32 AM 1/5/2005, Adrian Pitt wrote:

> In summary, I want to know
>if the next trading bar to appear on the chart will be in a new month
>compared to the most recent bar on the chart. Obviously its apparent in
>real time, but for backtesting I can't find a way.


At 06:32 AM 1/5/2005, Adrian Pitt wrote:

>Can anyone offer any suggestions here please? In summary, I want to know
>if the next trading bar to appear on the chart will be in a new month
>compared to the most recent bar on the chart. Obviously its apparent in
>real time, but for backtesting I can't find a way.

On thinking about this more, my previous suggestion, using NextOpen DLL, will not work. The NextOpen DLL only gives you the Opening Price, not the date.

There is a set of functions from Avicom, Inc. (www.avicominc.com) that will allow you to refer to any bar on the chart from any other bar. It should certainly work for this case. (See info from the help file below.)

Bob Fulks

====================================

 From the Avicom Help File:

Av.ELGetBarInfo ( nInfoType numeric, nBarIdx numeric )

Use this command to retrieve information about a particular bar forwards or backwards from the current BarNumber.  This function supports all bar information.  They are:

High
Low
Close
OI
Date
Time
Upticks
Downticks
Volume

Normally, TradeStation cannot  look at a bar until the bar is complete.  This can limit the kinds of systems we can write.  Any data in these fields on a chart can be retrieved before or after the current BarNumber. Use this function to reference any bar at any point backwards and forwards from the current bar. One really useful way to use this function is to place orders based on the next ( but incomplete) bar's Open.  

Referencing outside the boundaries of the chart (i.e. 4 bars in the past when BarNumber = 1 or 4 in the future on the last bar) will return an undefined result (garbage).