Intraday Hour Rule
Author: allanpeace
Creation Date: 1/6/2015 3:52 PM
profile picture

allanpeace

#1
The Intraday Rule HHMM indicates to enter as 4 integers, ie 0955 for 955am. It resets to 955, and so it naturally doesnt work. Does not filter out trades prior to 9:55am. It says Community Indicators are need, which are installed and currrent.

What should I try?
profile picture

Cone

#2
There must be something else that's causing that. The rule uses the string as an integer [time] value, so 0945 is the same as 945.

Click the "View Strategy Code" button and post it here so we can take a look.
profile picture

Eugene

#3
QUOTE:
It says Community Indicators are need, which are installed and currrent.

It says Community Components are required, which appear to not be installed. Hence a compile error?
profile picture

allanpeace

#4
I meant to say Components.
Here are the screen shots of the rule in place, yet it still trades when it wants to. The instructions say to put a "0" in front of the 9,, but it won't accept it.
profile picture

allanpeace

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

allanpeace

#6
I also tried using 1000 as in 10 am. Switching between the two intraday time rules, I found I could exclude all trades After 10 am,, but not exclude trades before 10 am.
profile picture

Eugene

#7
Well, I checked it and the Strategy works correctly i.e. exactly as designed. Firstly, it does not matter whether is the time entered as 0955 or 955. The leading zero is dropped from calculations anyway so it works in either case.

The 9:31 entry is perfectly valid because the signal was generated on the last bar (4pm) when the condition held true (4pm > 955am) BUT you don't consider that your strategy actually buys at market next bar. That next bar may happen next day but signal evaluation happened at 4pm, issued an alert, and no more evaluation follows. It is by no means a violation of the rule. Makes sense?

If having a hard time understanding the concept, here's more insight from the FAQ > Is it necessary to have access to intra-bar tick data to daytrade with Wealth-Lab?

Consequently, to avoid triggering signals on the first bar of the next day you can simply add a "Time is earlier than HHmm" set to 1555 (for 5-minute bars).

P.S. Since "Required conditions" is set at 2 and the lookback period is 1, there's no real need in Multi-Condition Groups in this example case (conditions are added together by default).
profile picture

Cone

#8
QUOTE:
to avoid triggering signals on the first bar of the next day you can simply add a "Time is earlier than HHmm" set to 1555 (for 5-minute bars).

Actually, to avoid triggering a trade on the last bar of the day (which will enter on the first bar of the next day) you should add "Time is earlier than HHmm" set to 1600. That would work for any intraday scale. Remember that in Wealth-Lab, bars are time stamped on the end-of-bar.

Exception:
This won't work on the half sessions that end at 1300. To make the strategy more robust, you'd need to manually add this rule:
CODE:
Please log in to see this code.


profile picture

Cone

#9
This rule is now available in the updated Community.Rules, available at the wiki.
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).