- ago
First of all thank you to the admins for their reactivity and sorry to repeat myself because I am not explicit enough. I made a FeatureRequest about evolver, actually that's not really what I'm looking for. For me, I'm looking to create data filters.

When I use extensions or tools, I am not necessarily looking for a new strategy but I am also looking to perfect an existing (winning) or trending strategy. For this, I propose to be able to create new datasets from a strategy.

for me, being able to filter the data to keep what is needed and remove the rest will save us and the machine a huge amount of time.

Imagine taking a basket of stocks like the S&P 500, having filtered data on uptrend, downtrend, corrective conditions... allows me to work on backtests only on those key moments.
Of course, the basic brick does this job, but we can't manage that on the extensions and likewise, it weighs down the machine.

Another example of use: I want to test a 5min strategy over 10 years, I create a daily data filter to take only the key moments and delete the rest so as not to take all the data (lighten/alleviate the machine).

So I would have some kind of data called: SP&500bullish-Daily
which I use for my 5min strategy (or tools and extension).

Also, I don't know of any software that can do this. Still, this seems simple to me (create a building block strategy and the data that meets the conditions press "converted to new data")
0
380
9 Replies

Reply

Bookmark

Sort
Cone8
 ( 24.08% )
- ago
#1
In a few seconds, you can create a DataSet using a technical filter on the S&P 500, Russell lists, etc., using Tools > New Strategy Screener Window (Ctrl + E). Just use a strategy that will generate signals for your criteria and use one of the Create DataSet options.

QUOTE:
Another example of use: I want to test a 5min strategy over 10 years, I create a daily data filter to take only the key moments and delete the rest so as not to take all the data (lighten/alleviate the machine).
"Delete the rest" is not going to happen. If you test a 5 min strategy over 10 years, you need 10 years of 5 min data. That's not going to change with a feature request.

Look, you can use Daily data to create filters for intraday trading, but the backtest engine requires all of the data to be there. We're not going to break up bar histories in pieces just because you want to do it in a different way.

Let's ask a different way.
What precisely is the problem that you're trying to solve?
2
- ago
#2
QUOTE:
For this, I propose to be able to create new datasets from a strategy.

This may be possible, if you mean generation of new DataSets in C# code. It would operate on the whole DataSet, an algo would apply a criteria on the last bar to filter symbols to include, etc. Though I don't have an example at hand.
0
- ago
#3
Cône I'm not looking for a screener.

Here is an example with the AAPLE graph:

First image, if I tell my screener I'm looking for stocks that are above the SMA50 and 20, APPLE won't show up because today it's below.


Here is the data I'm looking to work with (second image) for extensions and tools with the same conditions.


But if I understood correctly it is not possible (perhaps the fact of cutting the Candlestick?).

Eugene could you enlighten me on "generating new DataSets"? I don't know how to code
0
Cone8
 ( 24.08% )
- ago
#4
Run this code with your Intraday data and see if you get the idea.

CODE:
using WealthLab.Backtest; using System; using WealthLab.Core; using WealthLab.Data; using WealthLab.Indicators; using System.Collections.Generic; namespace WealthScript7 { public class MyStrategy : UserStrategyBase { //create indicators and other objects here, this is executed prior to the main trading loop public override void Initialize(BarHistory bars) {          _daily = WLHost.Instance.GetHistory(bars.Symbol, HistoryScale.Daily, DateTime.MinValue, DateTime.MaxValue, 0, null);          _sma20 = SMA.Series(_daily.Close, 20);          _sma20 = TimeSeriesSynchronizer.Synchronize(_sma20, bars);          _sma50 = SMA.Series(_daily.Close, 50);          _sma50 = TimeSeriesSynchronizer.Synchronize(_sma50, bars);          PlotTimeSeries(_sma20, "SMA20", "Price", WLColor.NeonGreen);          PlotTimeSeries(_sma50, "SMA50", "Price", WLColor.NeonRed); } //execute the strategy rules here, this is executed once for each bar in the backtest history public override void Execute(BarHistory bars, int idx) { if (!HasOpenPosition(bars, PositionType.Long)) {             //code your buy conditions here             if (bars.Close[idx] > _sma20[idx] && bars.Close[idx] > _sma50[idx])             {                // do something here             } } else { //code your sell conditions here } }       //declare private variables below       BarHistory _daily;       TimeSeries _sma50;       TimeSeries _sma20; } }
0
- ago
#5
execute, but what is the difference with a building block ? I do not understand
0
- ago
#6
This is mutual: we seem to not understand you either 😃 At least the explanation in the post with screenshots has confused me even more. I'm still at a loss as to what and why you want to do something with data (truncate?)
0
Cone8
 ( 24.08% )
- ago
#7
There are 2 ways to get what you want. The first is my code above. It grabs the Daily data, creates the moving averages, and synchronizes those indicators with the intraday chart. You can then use them in your entry rule, which is also shown. The "if" condition is true only if the closing price is above both indicators.

The second way it to do almost the same thing in the Blocks using ScaledInd, and in this case, you'll be creating those Daily indicators from your intraday data. The slight disadvantage here is that you'll need to add at least 50 extra days of data to the start of your backtest to make the Daily indicators valid.

p.s., Make sure to upgrade to Build 40 to get the ScaledInd for 2 different SMA periods.
0
- ago
#8
I better understand the advantage of the code, do you by chance have an example of a multi-timeframe code? so that I am inspired
0
Cone8
 ( 24.08% )
- ago
#9
Do you mean a different example from the one I just posted? I thought it was very inspirational. It shows how you can get a 50-period Daily SMA valid on the first bar of your intraday data.

In the blocks, you only need to use ScaleInd to create those Daily SMA filters. You can use them like any other indicator, .e.g., Indicator Compare to Indicator when you make sure the Close is above or below that ScaledInd(SMA).
0

Reply

Bookmark

Sort