OmniTrader Professional Forum OmniTrader Professional Forum
forums calendars search
today this week
 
register logon control panel Forum Rules
You are currently browsing as a guest.
You should logon to access more features
A Self-Moderated Community - ALL MEMBERS, PLEASE READ!
Vote for Members who contribute the most to your trading, and help us moderate content within the Forums.


This message cannot be deleted. It is the first message of the thread.
Administrators or moderators may choose to delete the entire thread


 
Jim Dean

Sage
2000100010010010010025
Posts: 3433

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : Intraday Plotting - Particular Day, Specific Times
Posted : 1/25/2010 3:00 PM
Post #15015

The attached code is an example that helps illustrate and explain several things that are outside of Nirvana's current documentation ... since it uses some native Visual Basic functions.

Don't let that scare you away.

This example illustrates two very useful things for use with intraday plotting:

1. How to limit your plot to a particular day

2. How to PricePlot a series of separate segments of intraday bars within that day, WITHOUT those segments being connected to one another, OR to a comparable time-segment from the prior day.

The function allows you to input all-zeros to specify that the plots are to occur for the CURRENT day ... and it automatically compensates for plots that you might be doing on Saturday or Sunday ... in that case, it plots the previous Friday.

It also allows you to specify a particular YYYY MM DD during which the plot should be done.

It also (and this is sorta cool) allows you to do the plot on a specified number of weekdays BEFORE the current day. If you span a weekend or two (or whatever) in the process, it automatically compensates for the Sat & Sun's in the calendar that are not trading days. That is, you input the number of TRADING days ago.

There's one gotcha ... I did not build in the (messy) code that would be needed to auto-skip any trading holidays that occur M-F ... you need to input one extra day-ago for any of those.

The example arbitrarily draws some lines above and below the price bars to show how they can be turned "on" and "off". The trick is to name each segment differently. This is ALL you have to do if you are working with daily bars ... but with intraday bars, you ALSO need the extra code to isolate what day you want to plot.

This could be readily expanded to permit plotting over a range of calendar days. Theoretically, any trading holidays that are known ahead of time could be hard-coded as well.

CAVEATS:

The arbitrary choice of plotting five separated segments per day to illustrate this procedure IS based on a 390-minute day. There are situations where a trading-day's intraday-data might have MORE OR LESS than 390 minutes ... it could include pre- and post-market data; futures/forex is different; partial-holidays are different. However, none of these issues relate to the two main things illustrated by this code:
1. How to focus plotting (or calcs) on a particular day, and
2. How to plotprice individual segments within a day


I hope this code is helpful to many people ... the programming of intraday stuff is sort of trick-sey, as Gollum would say ...








[Edited by Jim Dean on 3/28/2015 7:22 AM]

Attached file : IntradayBarSegPlot - ScreenSnap.png (44KB - 1292 downloads)
Attached file : aJDndIntradayBarSegPlot.rtf (5KB - 1007 downloads)
Attached file : IntradayBarSegPlot - CodeSnap.png (97KB - 1243 downloads)

Deleting message 15015 : Intraday Plotting - Particular Day, Specific Times


Nirvana Systems
For any problems or issues please contact our Webmaster at webmaster@nirvsys.com.