Welcome to the Traders Laboratory Forums.
Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
Old 08-24-2009, 06:35 PM   #9

Trader333's Avatar

Join Date: May 2008
Location: UK
Posts: 153
Ignore this user

Thanks: 79
Thanked 24 Times in 20 Posts

Re: Multi Time Frame Indicator

Here is the globalvariable dll file (which may already be available elsewhere on the forum). Anyway you need to extract the file and place it into your program directory of tradestation.


Paul
Attached Files
File Type: zip GlobalVariable22.zip (192.4 KB, 25 views)
Trader333 is offline  
Reply With Quote
Old 08-25-2009, 01:11 AM   #10

Join Date: Jul 2008
Location: Bangkok
Posts: 11
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Re: Multi Time Frame Indicator

You can do this 2 ways. First and easiest is to put the 3 timeframes on 1 chart, then you don't need to use Global Variables. The Global Variable option can only be used in real time, you can't look at past data using that method.

This is because TS loads up chart by chart, not minute by minute. You can use volume, ticks or time bars.

If you are testing for direction, you have another issue to overcome...




The chart has the e-mini 1 min (shown) and the e-mini 10 min (hidden)
The first CCi indicator is on the 1 min
The second CCi indicator is on the 10 min
The last #PD_MTF_TEST indicator shows the direction of the CCi,red = down, green = up. The first row of dots is the 1 min, the second row of dots is the 10 min.

So you can see that 7:20-7:30 the CCi 10 min was up slightly but this isn't shown 'in the dots' until the bar closes at 7:30. The bottom row of red dots showing direction of the CCi from 7:30 to 7:40 is based on it's direction from 7:20 to 7:30.

Likewise, the bottom row of red dots from 7:40 to 7:50 shows red which is based on the CCi direction from 7:30 to 7:40.

Whilst this is all just sample code to show the concept, what I was trying to do generally is use higher timeframes to give direction and lower timeframes for entry. This isn't much use if you can't get the 10 min direction as it's changing.

Now - in real time this is different - you will see the CCi direction moving for the current 10 min bar as the bar is in progress. Even after the first minute of the 10 minute bar, if the strength of the move is enough to change the direction of the 10 minute bar, you use that immediately.

The answer is in the use of synthetic bars. The second attachment shows the same indicator with a 'synthetic' version overlayed and how you can see the higher time frame indicator plotted out closer to the way it does in real time.

Whilst a lot of people don't seem to be able to wrap their heads around this issue, what it means is that you you use these indicators in multiple timeframes in a strategy, your strategy entries & real-time entries will be different & the results you get will not be based on the entry technique you think you are coding....

Pete
Attached Thumbnails
Multi Time Frame Indicator-mtfissue.gif   Multi Time Frame Indicator-mtfsolution.jpg  
Pedro01 is offline  
Reply With Quote
Old 08-25-2009, 12:09 PM   #11

Join Date: Mar 2007
Location: London
Posts: 2
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Re: Multi Time Frame Indicator

Interesting approach with the synthetic candles. I presume there's an overhead here of having to rewrite all indicators which use synthetic candles. Do you keep that in EasyLanguage or call out to C/C++ code for speed.
monowheel is offline  
Reply With Quote
Old 08-25-2009, 07:14 PM   #12

Join Date: Jul 2008
Location: Bangkok
Posts: 11
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Re: Multi Time Frame Indicator

There's an overhead both in the extra time it takes to write/test the indicators as well as at execution time and the overhead is hughe.

Saying that, I only use strategy code for testing a strategy, for real time execution, I use code with embedded macros which allows you to build in some redundancy. For instance, with macro code you can place a stop order as well as code to monitor the current price vs stop price. If you go through the stop price, you can place a market order as a 'backup' to your stop order.

It may seem like overkill but I prefer to have that extra degree of control you get with the macros.
Pedro01 is offline  
Reply With Quote

Reply

Tags
multiple time frame

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using More Than One Time Frame in a System hrokling Automated Trading 2 04-21-2009 01:46 PM
Higher Time Frame Indicator for TS drsushi Coding Forum 9 04-23-2008 05:50 PM
Time Frame Control MrPaul Market Analysis 1 11-29-2007 12:31 PM
Use Fib projection on small time frame (1 Feb 07) kingking E-mini Futures Trading Laboratory 0 02-16-2007 11:17 AM
Trading opportunity in the smaller time frame kingking E-mini Futures Trading Laboratory 3 02-13-2007 08:20 AM

All times are GMT -4. The time now is 01:38 PM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.