GetSessionOpen, Strategy monitor scheduling and partial bar data?
Author: kbellare
Creation Date: 11/26/2013 9:15 PM
profile picture

kbellare

#1
Couple of questions reg. same day execution
1) If i use GetSessionOpen(bar+1) in my Buy condition and set schedule strategy monitor to execute mid-day on a Daily strategy (US stocks data-set), will it alert and stage orders mid-day?
e.g. if (GetSessionOpen(bar+1)>Low[bar] && GetSessionOpen(bar+1)<<High[bar]) BuyAtLimt(bar+1)

2) Is there mid-day (partial bar OLHC) data available from either Fidelity or other static data providers I can use in this strategy? Would like to evaluate partial-day bar Indicator[bar+1] that uses Open and mid-day Close in my Buy condition if possible

thanks
Kiran
profile picture

Eugene

#2
1) Why not? GetSessionOpen is already OK to run shortly after the market open.

2) In theory, accessing partial bar OHLC data is possible using Yahoo! (Wealth-Lab User Guide > Data > Data Manager > Create New DataSet > Data Providers > Yahoo!)
profile picture

kbellare

#3
Currently, my strategy Buy condition references bar+1 (sample code below) and it backtests without spitting errors (i recognize that it's not fully accurate as partial bars can reverse direction). If I activate this strategy in the Strategy Monitor to generate mid-day alerts and Yahoo's partial bar-capable Daily data ..

1) how does my strategy code need to change to import the partial bar and evaluate the "partial Close"? Will the strategy monitor handle that seamlessly when it gets scheduled?

2) Also, where do i include GetSessionOpen function?

CODE:
Please log in to see this code.


profile picture

Cone

#4
CODE:
Please log in to see this code.
Since the trade (limit order) must occur sometime during bar + 1, this condition requires a crystal ball and therefore cannot be used.

What <value> should be used? What does the limit trigger price depend on?

Did you review the design pattern (example) for using GetSessionOpen in the QuickRef (F11)?
profile picture

Eugene

#5
QUOTE:
this condition requires a crystal ball and therefore cannot be used.

Let me disagree, with Y! partial bar data updated during the day it can work w/o peeking. However, since the logic highly depends on execution time (mid-day), you really should not be coding it this way i.e. as a EOD strategy. It's not backtestable w/lo looking at a lower bar scale. IMO, it should be converted into a pure intraday strategy.
profile picture

Cone

#6
It would work only on the last partial bar, but this was not specified and there really isn't a good way to enforce that condition for a trade that actually took place. Agreed that it must be an intraday strategy.
profile picture

kbellare

#7
Thanks - i'll go the Intraday route. Couple of questions

- Is there an equivalent of Bars.IntradayBarNumber function for large intraday intervals such as 60 minutes e.g. a Bars.IntraLargeIntervalBarNumber(60) ?
- Also, want to see if trades correlate better with some fundamental indicators (P/E ratios, etc) - how do i project those on the Analysis tab in Performance Visualizers?
profile picture

Eugene

#8
1 - I'm sure it would be there if the developers saw some point in that. ;)
2 - Follow the User Guide (Preferences > Performance Visualizers > Analysis Series) and Wiki tutorial.
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).