No signals in Strategy Monitor for weekly timeframe
Author: Gamba
Creation Date: 3/19/2012 2:24 AM
profile picture

Gamba

#1
Hi,

I founda strange behaviour with using weekly charts in a portfolio or single stock
strategy. In one of my strategies for a weekly timeframe in Strategy Monitor I don't get signals.
Yes, I use the same parameters than in backtest (2000 fixed dollar, three years back, weekly).

I cannot understand this behaviour and enabled logging. The log file says nothing.
So I tried to simulate the error with Channel Breakout VT.

I only changed timeframe to weekly and edited the code to use long channel 20 and short channel 10
as parameters. I cann reproduce another strange thing for a weekly timefare, for daily basis it seems
to work fine. I tried with one symbol AA because the strategy is coded only for single symbols.

I enabled downloaded data till 2012/03/16 and it worked find for a daily basis. At 03/16 there was a buy signal
for AA and the strategy (in Strategy Monitor) generated a Sell signal.

But for weekly timeframe I get the following error in the log:

CODE:
Please log in to see this code.


Data is loaded as mentioned above. I checked this with Data Tool.
Maybe this one is related to my other strange behaviour on weekly basis.

Thx
Gamba
profile picture

Eugene

#2
Hi,

I was able to reproduce the error but it's intermittent. Oddly enough, 'Channel Breakout VT' (and not with 'Bandwagon Trade' for example) configured as indicated (RP $2,000, 3 years, Weekly, 20/10)...

A. produces the error message on Yahoo! (with any possible provider settings), Random, or Google DataSets, but
B. there's no error with QuoteMedia or Finam DataSets, for example.

Sure enough, all DataSets are up to date, there's more than enough data for the Weekly calculations.
profile picture

Eugene

#3
P.S. Some backround on this error (that doesn't seem to be helpful in our case) from the Knowledge Base: Errors | Strategy > "DataSeries do not have equal number of values for mathematical operation"
profile picture

Gamba

#4
On the other hand, the root cause is, especially for my strategy mentioned above, that
it does not generate any signal and NO error on weekly basis. During backtesting
some signals for today are generated.

I read in programming guide to use only one (the last) bar in Strategy Monitor and not the whole
loop. But if I program it like this I get other errors, that the index was not correct
and I cannot monitor my orders. Am I right to this point? I cannot monitor my order
after a Buy signal, because the next day/week I only check the last bar?

So I think it is much better to use the main loop for iterating the last X bars or last 2-3 years,
if I want to monitor my entry orders and produce exit signals for it, isn't it?
profile picture

Eugene

#5
QUOTE:
I read in programming guide to use only one (the last) bar in Strategy Monitor and not the whole loop.

You are probably referring to a "screener" script referenced in the WealthScript Programming Guide: Techniques > Creating a Screener. We're not advising to adjust the Strategy for use in the Strategy Monitor, that's a misconception.
profile picture

Eugene

#6
QUOTE:
So I think it is much better to use the main loop for iterating the last X bars or last 2-3 years,
if I want to monitor my entry orders and produce exit signals for it, isn't it?

Of course.
profile picture

Gamba

#7
Ok, I'm sorry I read "screener" and thought you mean the "Strategy Monitor". So no
changing is necessary and recommended in "Strategy Monitor" ... thank you for
make that more clear to me.

... and now, back to that weird error with Yahoo / Weekly / Channel BO ...
profile picture

Gamba

#8
FYI:

I tested my strategy on weekly and daily timeframe now. Everything works fine an daily basis
in Strategy Monitor, orders were generated (Buy and Stop) like in normal backtests.

On weekly basis, no error (in log), no exception (tried with try ... catch) and no orders,
but backtest generated orders for today.
profile picture

Gamba

#9
Google provider doesn't work for me too. BBFree has another strange behaviour.
It seems to work without error, orders are generated, but orders are one day late
and there are multiple orders for one symbol. For example BPOP should generate an buy order
for today, but in Strategy Monitor there are already 2 Profit-Target and 2 Stop orders.

If I double-click on one BPOP order the chart was opened and I can see only one buy alert
which is correct. During backtest there is also only one buy order.

So, at the moment I don't know whicht provider to use and which of them works without errors
on weekly timeframe basis.
profile picture

Eugene

#10
We'll have to investigate this behavior further, why does Channel Breakout VT generate that error and other Strategy won't do the same.
profile picture

Eugene

#11
Found the culprit behind this error:
QUOTE:
Error(4): DataSeries do not have equal number of values for mathematical operation

The error message occurs when shifting a DataSeries:

QUOTE:
// shift the plotted series to the right one bar to visualize the crossings
PlotSeries(PricePane, H55 >> 1, Color.Green, LineStyle.Solid, 1);
PlotSeries(PricePane, L21 >> 1, Color.Red, LineStyle.Dotted, 1);
PlotSeries(PricePane, H21 >> 1, Color.Blue, LineStyle.Dotted, 1);
PlotSeries(PricePane, L55 >> 1, Color.Fuchsia, LineStyle.Solid, 1);

It's not about plotting but instantiating the shifted DataSeries.

Likewise, add this line to "Bandwagon Trade" and it will start failing with the same error code:
CODE:
Please log in to see this code.


Holger, here's a workaround for you. Replace the >> in your code with something like this:
CODE:
Please log in to see this code.

The idea is to set the scale to Weekly, build your shifted DataSeries manually, and restore back the scale.
profile picture

Eugene

#12
Added to the Open Issues list.
profile picture

Gamba

#13
Eugen, that fixes the problem with Channel Breakput VT. But as mentioned above
I have another trend-follwing strategy on weekly timeframe which does causes no
errors and still not generates any trades with Yahoo-Data.

In backtest there with settings Weekly, 01.01.2009 - 16.03.2012, $2000 RP, it generates
entry-orders for FNFG and BPOP and in addition other sell-target or stop orders.

With BBFree-Provider it generate trades but it seems, as already posted,
that the trades are one bar (week) later, so I get for FNFG (single symbol test in
Strategy Monitor) the stop and target order, not the entry order for this week.

After clicking on one order the chart and alert are fine and the I can see the entry order.
In conclusion both Yahoo and BBFree doesn't work as expected.

I don't have any shifting in code and I already tried to use SetScaleWeekly() for the used
data-series.

I can send you the complete code as private strategy, but I don't want to post it here.
Maybe the situation could be reconstructed with Channel Breakout without plotting methods.
profile picture

Eugene

#14
Thanks, your pointer to "Channel Breakput VT" was again helpful to reconstruct the situation. I can confirm both these issues.
profile picture

Eugene

#15
QUOTE:
With BBFree-Provider it generate trades but it seems, as already posted, that the trades are one bar (week) later, so I get for FNFG (single symbol test in Strategy Monitor) the stop and target order, not the entry order for this week.

That's expected, I think. In the Strategy Monitor, the weekly bar has not closed yet (see Next Run Time), while double-clicking on an alert opens a Strategy window which assumes that the OHLC bar has closed.
profile picture

Gamba

#16
Even if I specify the concrete date from 01.01.2009 - 16.03.2012?
I thought that 16.03 was the last bar and the last week for which
signals are generated?

On daily timeframe this works for me if I sepcify a concrete end date.
profile picture

Eugene

#17
Please note that you should not specify an End Date in the Strategy Monitor. It should be ignored by Wealth-Lab, but instead, data ends at the specified End Date for the native timeframe e.g. Daily.

(4167) End Date should be ignored in Strategy Monitor Date Range settings

If it's ignored in a compressed higher bar scale, that's fine.
profile picture

Gamba

#18
Ok, so signals for weekly scales should only be valid after friday's close
till sunday, if all data is up to date ... is this correct ...
profile picture

Eugene

#19
Yes, that's right.

Regarding the main problem (i.e. no trades/alerts in Strategy Monitor in non-native scales with some data providers). The issue has been reproduced and is currently under investigation.
profile picture

Gamba

#20
I would like to know the current status of this topic?
Should I open a support ticket regarding the main problem.
profile picture

Eugene

#21
No need in a support ticket, thanks.

Issue(s) submitted to the Fidelity development team. There's no status at this time.
profile picture

Sammy_G

#22
Currently using WLP v6.1. Was considering upgrading to v6.3 when this thread caught my eye.

Am I correct in understanding that:
1) There will be NO alerts for any strategy using weekly bars?
2) This is true across ALL data providers (I am specifically interested in Fidelity data provider)?
3) Is this just a Strategy Monitor issue or would also happen when a strategy is opened by itself and run using weekly bars?
profile picture

Eugene

#23
3) Purely a Strategy Monitor issue,
2) that happens with some data providers (no idea re: Fidelity data, both Gamba and I are WLD users),
1) when a native intraday/daily DataSet is being compressed into Weekly in the SM.

Not sure if it's even a 6.3 issue (haven't tested with previous versions).
profile picture

Sammy_G

#24
Would someone using WLP + Fidelity data care to test or comment on the Qs I raised?
Or just simply: Are you able to run strategies AND get alerts in the Strategy Monitor using weekly bars?
profile picture

Eugene

#25
Not many data providers out there offer native Weekly data and support the Strategy Monitor at the same time.
profile picture

Sammy_G

#26
Nor does Fidelity; the weekly is derived from daily (or intraday) data.

Regardless, its important for me know if alerts are going to be triggered in SM using weekly data bars.
profile picture

Cone

#27
It's certainly easy to test with this strategy and any time frame -

CODE:
Please log in to see this code.
It's works with the Fidelity Provider on Weekly bars for me, 6.3.14.
profile picture

Sammy_G

#28
That's what I wanted to know before contemplating upgrading to v6.3. Thx, Cone.
profile picture

Eugene

#29
An update on the bug:

The reason has been nailed down, and our current plan is to fix it on a by-provider basis: IQFeed, MSN, Yahoo, Google, Random.
profile picture

Eugene

#30
The issue has been fixed in Google and Random providers.

At this time we don't have an ETA for a fix in the remaining providers (IQFeed, MSN and Yahoo), sorry. Eventually we'll get to it.
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).