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.

  Current location        Thread information  
OmniTrader Professional Forum
OmniLanguage Discussion
Intraday Plotting - Particular Day, Specific Times
Last Activity 5/25/2019 11:20 AM
3 replies, 3771 viewings

Jump to page : 1
Now viewing page 1 [25 messages per page]
back reply
Printer friendly version

^ Top
Jim Dean

Posts: 3204

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.


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 - 668 downloads)
Attached file : aJDndIntradayBarSegPlot.rtf (5KB - 528 downloads)
Attached file : IntradayBarSegPlot - CodeSnap.png (97KB - 620 downloads)

^ Top

Posts: 384

Joined: 6/6/2006

User Profile
Subject : RE: Intraday Plotting - Particular Day, Specific T
Posted : 1/25/2010 3:21 PM
Post #15017 - In reply to #15015

Jim you seem to have put that together in no time at all; fabulous. If I can get my head around it it will be a fantasic help to me.

So as ever Thank you Jim
^ Top
Jim Dean

Posts: 3204

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

User Profile
Subject : Date and Time Info Avail to OmniLanguage
Posted : 2/15/2010 6:59 AM
Post #15400 - In reply to #15017

Here is another installment that helps document what the various date and time options are, and how the "bar-based" values differ from the "computer-clock" based values.

NOTE: THIS EXAMPLE IS PRINTED OUT ON A MONDAY MORNING BEFORE MARKET OPEN. There was a ToDo update done which captured all available data before these snapshots were taken.

The "debugmsg" output is used as the quickest way to test and document all the features. However, DON'T MISS the Plot commands and the Return commands ... these show how the values might be used in actual code.

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

Attached file : aJDndTimeInfoEOD - debugout.png (110KB - 569 downloads)
Attached file : aJDndTimeInfoEOD - codesnap.png (44KB - 582 downloads)
Attached file : aJDndTimeInfoEOD - screen&FL.png (30KB - 550 downloads)
Attached file : aJDndTimeInfoEOD.rtf (2KB - 365 downloads)

^ Top
Jim Dean

Posts: 3204

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

User Profile
Subject : RE: Date and Time Info Avail to OmniLanguage
Posted : 2/15/2010 7:16 AM
Post #15401 - In reply to #15400

Additional notes for the prior post:

Full info re dotNET date and time stuff is avail at:

ALSO, here are a couple of examples of additional possibly useful functions you can play with, which I failed to include originally ... the URL indicates many others ...

debugmsg("==== time-math ====")
debugmsg("Add 24.5h= "&now.addhours(24.5))
debugmsg("DST? = "&now.isdaylightsavingtime())

Jump to page : 1
Now viewing page 1 [25 messages per page]
back reply

Legend    Action      Notification  
Forum Moderator
Registered User
Unregistered User
E-Mail this thread to a friend
Toggle e-mail notification

Nirvana Systems
For any problems or issues please contact our Webmaster at