Intraday conditions for a strategy that executes trades on daily data
Author: tradeoholic
Creation Date: 4/8/2021 12:57 PM
profile picture

tradeoholic

#1
Hi,

I wonder if it is possible to mix intraday conditions into a strategy, that executes trades on daily data.

I have daily data from Yahoo for ^HSI and SPY, and
I have intraday 1 minute data for DAX30 from Metatrader static provider.

Rules:
-if ^HSI moved up from open to close +1% and DAX30 moved up from 09:00 (German merket open in
German time zone) to 15:30 (US market open in German time zone)
-then buy SPY at merket open and sell it at market close on the same day.

I tried to start writing the code, but can't work out how can I combine these conditions on data with different timeframes. Is it possible at all ?
profile picture

tradeoholic

#2
Sorry the condition for DAX30 is moving up 1% from 09:00 to 15:30.
profile picture

Cone

#3
Sure it's possible. See the Help > WealthScript Prog. Guide > Multi-Time Frame Analysis
profile picture

tradeoholic

#4
I found a description in the WealthScript Prog. Guide (Accessing Intraday data from Daily)
I tried the write the code according to it, but there are red underlined parts and it doesn't run.
What is wrong ?

I ran it on daily SPY data.

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

Cone

#5
Ok. Here's what you need to know:

1. If the Strategy Compiles sucessfully, don't worry about the red lines. But with a successful compile, you can avoid the red lines by give the WealthScript class a unique name, like you did here:

CODE:
Please log in to see this code.


2. If the Strategy compiles with errors - like this strategy - the red lines are likely to show you where the errors are. You need to correct those.
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).