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 ?
Size:
Color:
Sorry the condition for DAX30 is moving up 1% from 09:00 to 15:30.
Size:
Color:
Sure it's possible. See the Help > WealthScript Prog. Guide > Multi-Time Frame Analysis
Size:
Color:
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.
Size:
Color:
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.
Size:
Color: