kazuna8
 ( 34.34% )
- ago
In WL6.9, my intra-day strategy relies on the opening price can access the official open price via GetSessionOpen.

Accessing the official open price is crucial when trading with the multiple streaming sources.

Any plan supporting GetSessionOpen equivalent API in WL7?
7
1,601
Solved
8 Replies

Reply

Bookmark

Sort
Glitch8
 ( 12.10% )
- ago
#1
I'll add a GetSessionOpen method and complete the QuickRef documentation for the MarketDetails and MarketHours classes which expose it currently ... BarHistory.Market property.
0
- ago
#2
I thought it's no longer possible to do now in WL7. In static providers we even remove today's partial bar.

Dion, topic starter is not asking for market's metadata (MarketDetails and MarketHours) such as session's opening time. He's rather looking for equivalent of WL6's function that let you query the incomplete (partial) bar's Open after the market open:

QUOTE:
Returns current trading session's opening price for the specifed symbol. Returns 0 if the session's open price is not available or if the method is not supported by the DataSet's Data Provider.

GetSessionOpen() is designed primarily for EOD Strategies that require action based on the trading session's opening price (see Example). While it's still recommended to perform a Daily price update beforehand, you can schedule the Strategy Monitor to execute on the open of the market session. If you require a short delay to ensure all stocks have opened, you can right click the Strategy and choose "Run this Strategy now" or run the backtest in a Strategy Window.

Remarks
GetSessionOpen() employs the Static Data Provider to return the session's opening price; implementations vary by Provider. For example, in response to the first call to GetSessionOpen(), the Fidelity Static Provider requests and caches the opening prices for all symbols in the DataSet. If the DataSet is large, processing the first symbol in the DataSet will appear slow while opening prices are collected.
Intraday Strategies can directly obtain the opening price by finding the open price of the first bar of the current day, given by Open[bar - Bars.IntradayBarNumber(bar)] in a bar-indexed loop. Nonetheless, if the open price is required prior to the completion of the first intraday bar, consider using GetSessionOpen().
0
kazuna8
 ( 34.34% )
- ago
#3
QUOTE:
you query the incomplete (partial) bar's Open after the market open

Exactly. A method to access the partial daily bar's Open from intra-day streaming strategy code.

Because intra-day market open price is vary from platform to platform, daily bar's open (aka official open price) is required as an anchor of the market open price to be shared among the realtime platforms and backtests for archiving a consistent result.

Other platform often provides such method.
0
- ago
#4
I'm afraid this is no longer possible in WL7.
0
Glitch8
 ( 12.10% )
- ago
#5
We could add some access to the streaming data within a strategy as a future enhancement.
0
Glitch8
 ( 12.10% )
- ago
#6
It's time to allow strategies to access the session open price in a manner that works with the WL8 framework. I'll be adding a new override method to UserStrategyBase - ExecuteSessionOpen. You will be able to override this method to do processing and even place orders. WL8 will pass the detected session open price as a method parameter. The idea is that this will work in backtesting as well as live trading.

I'll refactor the "One Percent a Day" Strategy to employ this new method.
0
Best Answer
- ago
#7
Has the One Percent a Week strategy been updated with this method? I do not see it in my version so just wondering if it is me or just hasn't been updated yet.
0
Glitch8
 ( 12.10% )
- ago
#8
I just updated my personal copy for now. Let me clean up the code a little and I can update the installed sample Strategy.
1

Reply

Bookmark

Sort