Forex
Google

Go Back   Forex Trading > Discussion Areas > Suggestions for Trading Systems
Forex Forum Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


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 12-19-2005, 11:11 PM
sailor sailor is offline
Senior Member
 
Join Date: Oct 2005
Posts: 223
sailor is on a distinguished road
multiple timeframes

Any know if it is posible to programe an indicator which allows multiple timeframes ( to add for example 3 indicators in same chart Macd for example) And for example looks at weekly daily and hour 4 timeframes ?


Sailor
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 12-20-2005, 05:39 AM
lowphat's Avatar
lowphat lowphat is offline
Senior Member
 
Join Date: Sep 2005
Posts: 199
lowphat is on a distinguished road
its possible and even easy once you get the hang of making a basic expert from scratch. when your typing the code in the editor it will even tell you where to add the int timeframe which sets the mins for the pair. 240 mins for 4 hours etc.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 12-20-2005, 06:33 AM
sailor sailor is offline
Senior Member
 
Join Date: Oct 2005
Posts: 223
sailor is on a distinguished road
I was thinking of an indicator and not an expert :-)


Sailor
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 12-20-2005, 06:49 AM
igorad's Avatar
igorad igorad is offline
Senior Member
 
Join Date: Oct 2005
Location: Ukraine
Posts: 788
igorad is on a distinguished road
Hi,

Look at my indicator PriceChannel_Stop_v6.
Price Channel

Igor
TrendLaboratory Chief
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 12-20-2005, 06:58 AM
lowphat's Avatar
lowphat lowphat is offline
Senior Member
 
Join Date: Sep 2005
Posts: 199
lowphat is on a distinguished road
doh i have experts on the brain. this is something i needed to know also
thx for bringing it up and igor for the example
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 12-29-2005, 07:20 PM
sailor sailor is offline
Senior Member
 
Join Date: Oct 2005
Posts: 223
sailor is on a distinguished road
//+------------------------------------------------------------------+
//| MACD.mq4 |
//| Copyright © 2005, David W. Thomas |
//| mailto:davidwt@usa.net |
//+------------------------------------------------------------------+
// This is the correct computation and display of MACD.
#property copyright "Copyright © 2005, David W. Thomas"
#property link "mailto:davidwt@usa.net"

#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Blue
#property indicator_color2 Red
#property indicator_color3 Green

//---- input parameters
extern int FastMAPeriod=12;
extern int SlowMAPeriod=26;
extern int SignalMAPeriod=9;

//---- buffers
double MACDLineBuffer[];
double SignalLineBuffer[];
double HistogramBuffer[];

//---- variables
double alpha = 0;
double alpha_1 = 0;

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+1 );
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,MACDLineBuffer);
SetIndexDrawBegin(0,SlowMAPeriod);
SetIndexStyle(1,DRAW_LINE,STYLE_DOT);
SetIndexBuffer(1,SignalLineBuffer);
SetIndexDrawBegin(1,SlowMAPeriod+SignalMAPeriod);
SetIndexStyle(2,DRAW_HISTOGRAM);
SetIndexBuffer(2,HistogramBuffer);
SetIndexDrawBegin(2,SlowMAPeriod+SignalMAPeriod);
//---- name for DataWindow and indicator subwindow label
IndicatorShortName("MACD("+FastMAPeriod+","+SlowMA Period+","+SignalMAPeriod+")");
SetIndexLabel(0,"MACD");
SetIndexLabel(1,"Signal");
//----
alpha = 2.0 / (SignalMAPeriod + 1.0);
alpha_1 = 1.0 - alpha;
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int limit;
int counted_bars = IndicatorCounted();
//---- check for possible errors
if (counted_bars<0) return(-1);
//---- last counted bar will be recounted
if (counted_bars>0) counted_bars--;
limit = Bars - counted_bars;

for(int i=limit; i>=0; i--)
{
MACDLineBuffer[i] = iMA(NULL,0,FastMAPeriod,0,MODE_EMA,PRICE_CLOSE,i) - iMA(NULL,0,SlowMAPeriod,0,MODE_EMA,PRICE_CLOSE,i);
SignalLineBuffer[i] = alpha*MACDLineBuffer[i] + alpha_1*SignalLineBuffer[i+1];
HistogramBuffer[i] = MACDLineBuffer[i] - SignalLineBuffer[i];
}

//----
return(0);
}
//+------------------------------------------------------------------+








above is original code i thought i could just change this :

MACDLineBuffer[i] = iMA(NULL,0,FastMAPeriod,0,MODE_EMA,PRICE_CLOSE,i) - iMA(NULL,0,SlowMAPeriod,0,MODE_EMA,PRICE_CLOSE,i);
SignalLineBuffer[i] = alpha*MACDLineBuffer[i] + alpha_1*SignalLineBuffer[i+1];
HistogramBuffer[i] = MACDLineBuffer[i] - SignalLineBuffer[i];


any who can help me please

Sailor

Last edited by sailor : 12-29-2005 at 07:23 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 12-29-2005, 08:06 PM
newdigital newdigital is online now
Administrator
 
Join Date: Sep 2005
Posts: 15,436
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
I am not programmer but I intested this one in the beginning of the code:

Code:
extern int Per = 0;
Zero is for current timeframe (anycurrent according to the chart.

And then changed the line of the code on to this one:

Code:
ind_buffer1[i]=iMA(NULL,Per,FastEMA,0,MODE_EMA,PRICE_CLOSE,i)-iMA(NULL,Per,SlowEMA,0,MODE_EMA,PRICE_CLOSE,i);
It means as Codersgurusaid, after NULL should be timeframe. Zero (0) is current. So I inserted my "Per" (see above) instead of this "0".

Indicator is attached.

First macd_1.gif is 3 timeframes: M30, H1 and H4 on H1 chart using this new indicator.

And next two images is M30 and H4 timeframe (and chart) with normal MACD (just to compare).

May be I am not right. It is just my attempt.
Attached Images
File Type: gif macd_1.gif (20.2 KB, 143 views)
File Type: gif macd_m30.gif (17.8 KB, 105 views)
File Type: gif macd_h4.gif (20.2 KB, 93 views)
Attached Files
File Type: mq4 MACD_1.mq4 (2.4 KB, 39 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 12-29-2005, 08:29 PM
newdigital newdigital is online now
Administrator
 
Join Date: Sep 2005
Posts: 15,436
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
And an other image:

GBPUSD H1 Chart with e MACD indicators inserted:
for USDJPY, EURUSD and USDCHF.

So just 1 chart instead of 3.
Attached Images
File Type: gif macd_gbp_on_jpy_h1.gif (19.3 KB, 286 views)
Attached Files
File Type: mq4 MACD_2.mq4 (2.5 KB, 35 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 12-29-2005, 09:01 PM
sailor sailor is offline
Senior Member
 
Join Date: Oct 2005
Posts: 223
sailor is on a distinguished road
Thank u very much digital :-) looks ok.... being able to customize period like this is very very nice should be standard in mt4 platform :-)


Sailor
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 12-30-2005, 07:29 AM
newdigital newdigital is online now
Administrator
 
Join Date: Sep 2005
Posts: 15,436
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
Quote:
Originally Posted by sailor
Thank u very much digital :-) looks ok.... being able to customize period like this is very very nice should be standard in mt4 platform :-)


Sailor
I think it is really good idea to confirm the enters by different timeframes and pairs movements.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use of Many Timeframes dvarrin Metatrader 4 5 06-10-2007 12:42 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 01:14 PM.