Forex
Google
New signals service!

Go Back   Forex Trading > Discussion Areas > Metatrader 4


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-09-2007, 12:13 PM
Senior Member
 
Join Date: May 2007
Posts: 150
dvarrin is on a distinguished road
Use of Many Timeframes

Hi,

I would like to know if it is possible to get the data (tick price, close, high, low, indicators, ...) of an higher timeframe and use them in an expert advisor attached to a chart of a smaller timeframe.

For example, I would like to know how is the candlestick on the higher timeframe chart and use it as an entry point for the smaller timeframe chart.

I hope there is a solution :-)

Cheers,
Daniel
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-09-2007, 12:25 PM
zupcon's Avatar
Senior Member
 
Join Date: Dec 2005
Location: Malta
Posts: 205
zupcon is on a distinguished road
Quote:
Originally Posted by dvarrin
Hi,

I would like to know if it is possible to get the data (tick price, close, high, low, indicators, ...) of an higher timeframe and use them in an expert advisor attached to a chart of a smaller timeframe.

For example, I would like to know how is the candlestick on the higher timeframe chart and use it as an entry point for the smaller timeframe chart.

I hope there is a solution :-)

Cheers,
Daniel
Hi Daniel

If your coding using MT4, then you can specify timeframe for any indicator (its usually the second argument in any function call), same goes for obtaining OHLC data using the iOpen, iClose functions etc

If your trading manually, you might want to read the MTF multi timeframe indicator thread started by Kerris

regards
zu
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-09-2007, 02:17 PM
Senior Member
 
Join Date: May 2007
Posts: 150
dvarrin is on a distinguished road
Hi zu,

Thank you very much for your fast answer :-))

If we backtest an expert advisor and we are using the "Every Tick" model, does it mean that for the same bar, for example on the 15 min chart, we get some or all of its different states during 15 min?

In order to backtest my expert advisor, I would like to have livetrading-like behavior.

Cheers,
Daniel
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 06-09-2007, 02:53 PM
zupcon's Avatar
Senior Member
 
Join Date: Dec 2005
Location: Malta
Posts: 205
zupcon is on a distinguished road
Quote:
Originally Posted by dvarrin
Hi zu,

Thank you very much for your fast answer :-))

If we backtest an expert advisor and we are using the "Every Tick" model, does it mean that for the same bar, for example on the 15 min chart, we get some or all of its different states during 15 min?

In order to backtest my expert advisor, I would like to have livetrading-like behavior.

Cheers,
Daniel
Hi Daniel

Thats a very good question, and to be honest Im not sure of the answer because I dont use the backtester, due to its unreliability. My understanding is that if your testing a strategy on the 15 min chart, if you had for example 1 minute data available, then this would be used to simulate the ticks. However, I think that the model that they use to simulate ticks is quite basic (I think they assume linear interpolation between open, high, low and close). If no 1 minute data's available then it'll use 5 minute bars, and if no 5 minute data, 15 minute bars etc.

One thing I have done, is written an EA to record ticks and indicator settings, then compared real time signals to those subsequently interpolated by the EA in backtesting. My conclusion was the backtester is a waste of disk space, but there are a few people here with far more experience of using it, who understand its limitations and claim that it can be useful.

At one time there was a group of people collecting tick data from a number of brokers, as I believe they claimed the backtester could use this. I think they had a few problems as the file sizes can get quite large, and they where having to combine data from different brokers, with different timezones, gaps in the data etc. I think the projects still ongoing, Im sure there where a few regulars who post here who where involved

If I can remember the details, I'll post them here
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 06-10-2007, 12:03 AM
Senior Member
 
Join Date: May 2007
Posts: 150
dvarrin is on a distinguished road
Hi,

Thank you very much for you precious informations! I understand better how Metatrader is processing during the backtesting of an EA. There was some document on how to get a got sample of data for backtesting in one of the pdf file explaining the Phoenix trading system.

I'll try to load the one minute's chart :-) For sure it must be quite big and I know that backtesting an EA is never a good proof that it will work, but if I can use this kind of ticks' backtesting, it can give already a good idea of the result when trading live later on and the process to fine tune the EA is faster if we can perform quick tests.

Thanks a lot to you again!

Cheers,
Daniel
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 06-10-2007, 12:42 AM
wolfe's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 703
wolfe is on a distinguished road
Quote:
Originally Posted by dvarrin
Hi,

I would like to know if it is possible to get the data (tick price, close, high, low, indicators, ...) of an higher timeframe and use them in an expert advisor attached to a chart of a smaller timeframe.

For example, I would like to know how is the candlestick on the higher timeframe chart and use it as an entry point for the smaller timeframe chart.

I hope there is a solution :-)

Cheers,
Daniel
Pretty sure this is how you do it:

Lets say you want to use RSI, so you call it in your code.

vla=iRSI(NULL,0,14,PRICE_CLOSE,0);

The zero after null signifies current chart time frame.

If you want to read 4 hour time frame change to:

vla=iRSI(NULL,PERIOD_H4,14,PRICE_CLOSE,0);

Then attach to a lesser time frame chart.

You can use any of these values:

Constant Value Description
PERIOD_M1 = 1 minute.
PERIOD_M5 = 5 minutes.
PERIOD_M15 = 15 minutes.
PERIOD_M30 = 30 minutes.
PERIOD_H1 = 1 hour.
PERIOD_H4 = 4 hour.
PERIOD_D1 = Daily.
PERIOD_W1 = Weekly.
PERIOD_MN1 = Monthly.
0 (zero) = Time frame used on the chart.

Hope this helps.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
several timeframes in one MTF indicator fxbs Indicators - Metatrader 4 0 05-18-2007 06:46 AM
I need help with using switching timeframes in an EA carpe193deim Metatrader 4 1 03-12-2007 06:24 AM
Different timeframes for daily EA rjay Metatrader 4 3 12-29-2006 04:16 PM
Trading two timeframes Jovager Questions 2 10-10-2006 10:33 AM


All times are GMT. The time now is 10:04 PM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.