Wealth-Lab Wiki

API ChartStyles Community Components Community Indicators IndexDefinitions Knowledge Base Misc Optimizers Pending Deletion PosSizers Providers Standard Indicators TASC Traders Tips TASCIndicators Tutorial Videos Visualizers
RSS

Navigation


Quick Search
»
Advanced Search »


Intraday / Multi-Time Frame | Accessing Intraday data from Daily

RSS

The request

Sometimes, we get requests like this or that where you ask to code an indicator that is built on intraday data but the strategy should be executed on daily data.

Although the request is somewhat backwards from the traditional way of mixing scales, it's still possible as the following solution by Robert Sucher illustrates:

The solution

Normally, as the WealthScript Programming Guide instructs to in Multi-Time Frame Analysis, one starts with an intraday chart (the base time frame), create intraday and Daily indicators, and program it such that it trades EOD only. There are more possibilities in Version 6 for accessing data for the same symbol in different scales.

Below is an example of how to calculate and access a 30-min StochD in a Daily chart. As can be seen, the key is to use a GetExternalSymbol overload (QuickRef for more: hit F11) that allows to specify the DataSet with intraday data that will be searched when an external symbol is requested.

Code


using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators;

namespace WealthLab.Strategies { public class MyStrategy : WealthScript { protected override void Execute() { // Access the symbol from a DataSet whose base scale is intraday. Do not synch yet! Bars intra30 = GetExternalSymbol("Dow 30_30", Bars.Symbol, false); // Apply the indicator in the intraday scale DataSeries sto_intra30 = StochD.Series(intra30, 15, 3); /* Work-around for synch issue - we have to account for native synch erroneously delaying the intraday bars by one day in the following step. Advance the intraday bars by one day. The simple shift method only works if no short days are included in the series and you can guarantee that an intraday bar exists for each period of the day. Otherwise this step is more complicated. */ sto_intra30 = sto_intra30 << 13; // 13 30-min bars in a standard trading day // Synchronize to the chart scale (Daily) sto_intra30 = Synchronize(sto_intra30); // Plot the result. // You'll see the last value of the day for the 30-minute indicator for each day ChartPane stoPane = CreatePane(40, true, true); PlotSeries(stoPane, sto_intra30, Color.Green, LineStyle.Solid, 2); } } }

Notes

  • 30-min scale was used for the example because it's the highest native intraday timeframe you can get with Fidelity data. 60-min charts are actually scaled from the 30-min data for WLP, so you won't be able to access 60-min bars from a Daily chart. This limitation does not apply to Wealth-Lab Developer 6 users with IQFeed data, for example.

Important Disclaimer: The information provided by Wealth-Lab is strictly for informational purposes and is not to be construed as advice or solicitation to buy or sell any security.  The owner of Wealth-Lab.com assumes no liability resulting from the use of the material contained herein for investment purposes. By using this web site, you agree to the terms of this disclaimer and our Terms of Use.

Used under license from FMR Corp. Copyright 2008 FMR Corp. All rights reserved.


ScrewTurn Wiki. Some of the icons created by FamFamFam.