Bars of custom length (e.g. 73 minute)
Author: MrIzzy
Creation Date: 3/17/2010 7:18 PM
profile picture

MrIzzy

#1
Hi There,

There are Daily Bars in WL and also Weekly Bars. Can I create bars with custom lengths (e.g. 73 minutes each)? If so - how?

Thanks in advance.
profile picture

Cone

#2
Either I or Eugene misread the question, but you can rescale 1-Minute data using the Data Scale control. Just enter the number of minutes in the Custom Interval box.
profile picture

Eugene

#3
Facepalm :) I probably misread it, thinking of a more sophistitated stuff like MBars, Kase bars etc.
profile picture

MrIzzy

#4
Thank you all - but there is still a problem. There are 390 minutes in a trading day. I used 130 minute bars to run the script below (for example on AAPL). On Friday, March 19, the last daily close is shown as 222.21. However, on a normal dialy chart, the last close in AAPL is 222.25.

The question is: how can I access the TRUE Daily Close of a stock on a custom bar chart. Of course, this is required to run some strategies.

Thank you very much in advance.


Here are charts that illustrate this
http://www.box.net/shared/scoln4vrvp

CODE:
Please log in to see this code.
profile picture

Eugene

#5
QUOTE:
On Friday, March 19, the last daily close is shown as 222.21. However, on a normal dialy chart, the last close in AAPL is 222.25.

But on a normal Fidelity intraday chart (e.g. 5-minute), the last close of AAPL on 03/19/2010 is 222.21, so, manually scaling this data will return the correct value i.e. 222.21.

It's a different question why is daily data different from intraday.
QUOTE:
The question is: how can I access the TRUE Daily Close of a stock on a custom bar chart.

For example, use GetExternalSymbol(string dataSetName, string symbol, bool synchronize);
profile picture

MrIzzy

#6
Ok, Thanks. I stand corrected.
Here is my updated code. It still gives the wrong Daily Close when I run it on a 5 minute chart on AAPL. However, it gives the correct daily close for AAPL when I run ona 5 minute chart for a different stock.
I am using this on a strategy that uses two time frames for the same symbol. This problem did NOT arise when using Daily and Weekly charts. It does arise when using Intraday and Daily charts. What do you suggest?

CODE:
Please log in to see this code.
profile picture

Eugene

#7
Once again: there is no problem. Everything is by design.

Use a different GetExternalSymbol overload - the one above from my message @
3/21/2010 9:12 AM - to load the real Daily AAPL in a different, Daily DataSet (here I assume that Daily AAPL is in a different DataSet and its data is up to date.)
profile picture

MrIzzy

#8
Sorry - which is the dataSetName that I should use?
profile picture

Cone

#9
The name of the DataSet that contains the Daily AAPL data.

Keep in mind that Fidelity Daily data may not be "correct" until the corrections are applied by 6am the next day. (Daily bars may contain after market trades.) In my opinion, I'd trust the intraday bars for the 4pm close more than the daily bars' close, especially for the night of the close.
profile picture

MrIzzy

#10
Just in case I did want to reference the Fidelity data, what would be the name of the DataSet? thanks
profile picture

Eugene

#11
The name of the DataSet with the Fidelity data, as you named it. How do we know? :)
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).