GetSessionOpen with Metastock?
Author: abegy
Creation Date: 7/26/2013 5:45 AM
profile picture

abegy

#1
I would like to know if it is possible to use Getsessionopen wiith an EOD provider like Metastock file format.
Thanks for your assistance Eugene
profile picture

Eugene

#2
Think of Metastock or ASCII data like of Excel spreadsheet. It's available to Wealth-Lab in its entirety. If it contains the partial bar for today, you see it on the chart and can utilize in a Strategy. (Furthermore, there's no reliable way to tell if the market is open or has closed.) If your data vendor does not include that data, there is no way these providers can obtain it.

Data providers that connect to a web feed like Google are a different story. They can be likened to a workbook with multiple spreadsheets. Not only they support on demand data update, they might have a facility to request today's partial bar data and therefore make it available through GetSessionOpen.
profile picture

abegy

#3
Thank you very much. I have another question. Before to ask you my question, I will explain you what I would like to do to help you to understand the idea of the question.:

I would like to create a strategy which generates alerts only if the session open price hasn't a gap down according to the previous low price bar. If I have correctly understanding, the Quote tool manages a filter only for a gap up. Alerts must be created ASAP the session open price is available symbol by symbol. Each alert need to be push in the quote tool.

I have data in the EOD Metastock file format and an automatic update in "real time" by an external software. As my data provider doesn't give me the information that the bar is a partial one, I will write in my script a function to define if the bar is partial or not (base on computer time).

Is it possible to do what I want ? How ?
profile picture

Eugene

#4
The Gap Filter applies to all gaps, not just up gaps. If your strategy issues Limit orders, then the Quotes tool should fit the bill. Or does it not?
profile picture

abegy

#5
In the user guide, you find the following description :
QUOTE:
Activation
The Gap Filter is disabled by specifying 0% (default). To enable it, enter any positive number (2 decimals max);

with an example to say that
QUOTE:
// open of the trade day must be greater than 5% above the limit price

if (Open[bar+1] > limitPrice * 1.05)
BuyAtLimit(bar + 1, limitPrice);


If I want to do this :
QUOTE:
if (Open[bar+1] > limitPrice *0.99)
BuyAtLimit(bar + 1, limitPrice);


what must be the gap value to put ?
profile picture

Eugene

#6
The User Guide also states:

QUOTE:
To avoid triggering Alerts for gaps at or beyond the limit price itself, enter a small value, like 0.01. If the session's Opening price falls within that percentage, Alert triggering is blocked.
profile picture

abegy

#7
I want to cancel my alert only if the open price is under a specific value regarding the limit price. If I have understood correctly, when I put 0.01 in the gap filter, all open price under the limit price cancel the alert. Right ?
profile picture

Cone

#8
Entering 0.01 would actually inhibit triggering for an opening price 0.01% from the limit price, which is less than 1 penny (from the limit price) for all stocks trading under $100.

Consequently, so that your backtest history matches live trading, your strategy code should look something like this:

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

abegy

#9
My idea was to send an alert to the Quote tool if the session open price had not a gap price too low according the limit order. I see that it is not possible directly with the gap filter available in the Quote tool.

In a general point of view, what I would like to do was to be able to create alerts to the Quote tool according to a condition based on a session open price which can be the open price of the symbol (or an index, an indicator, another symbol...).

Is there a way to do it with the Strategy monitor tool with an EOD data file format with a "real time update" based on partial bar ?

profile picture

Cone

#10
If the idea is to solve the problem with the tools available, I think you're looking at it from the wrong angle.

Your idea is to filter alerts before sending them to Quotes. If you did that, you wouldn't need to use the Gap Filter, but you would need to use GetSessionOpen (and run the script just after the opening bell).

The more straightforward way is to send all alerts to the Quotes tool and use its Gap Filter to reject the trades that open too low (BuyAtLimit) or too high (ShortAtLimit). You don't need to use GetSessionOpen because the Quotes tool grabs the opening price from the streaming feed. With respect to a BuyAtLimit order, if the opening price is too low, the Quotes tool simply will not trigger the order - isn't that what you want?

The code I provided (slightly modified from that in the User Guide) triggers all Alerts (i.e., signals for tomorrow), but it includes the gap filter logic for the historical trades so that the strategy stays in synch with live trading. Clear?
profile picture

Eugene

#11
QUOTE:
You don't need to use GetSessionOpen because the Quotes tool grabs the opening price from the streaming feed.

One problem: there's no streaming feed in the Metastock provider.
profile picture

Cone

#12
I assumed abegy had a streaming feed too. Y! streaming for the Quotes tool ain't bad for something like $140/year as I recall...click the "More info on Premium Account" link the Yahoo! Data page in the Data Manager.

If you're going to trade like this, a streaming feed will certainly more than pay for itself w.r.t. your time and trading accuracy.
profile picture

abegy

#13
Yes. It's clear :-). Thank you
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).