Forex
Google
New signals service!

Go Back   Forex Trading > Metatrader Training > Metatrader 4 mql 4 - Development course > Questions


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 (2) Thread Tools Display Modes
  #911 (permalink)  
Old 01-12-2008, 06:50 PM
Putz's Avatar
Junior Member
 
Join Date: Aug 2006
Posts: 24
Putz is on a distinguished road
Step 1 and 2 working

Hi Sendra,

I just wanted to say thanks and let you know that I now have steps one and two working properly. Now I am working on steps 3 and +++. It's turning into a great exercise in learning.

Step 3 is trying to find out which indicator is the best to use to find the long term trend. I'm looking at Daily for now as it seems to work best for my system.

The one thing that I want to try is to find a way to confirm the change of trend as it seems that many times, most indicators show a change of thread, it reverses at that point and turns out to be nothing more than a retracement. I think that I would like to confirm the trend when the price passes the high or the low of the previous bar by x number of pips. I'm sure that somebody has already coded this but I have not been able to find it yet. If anybody has any suggestions, I would appreciate it.

Regards,
Putz
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #912 (permalink)  
Old 01-14-2008, 01:21 AM
MFM MFM is offline
Junior Member
 
Join Date: May 2007
Posts: 11
MFM is on a distinguished road
Hi there,
I created my first indicator and really happy about it. What I have is a 2map (1hour and daily) for trading only with the major trend.

On the 1hour chart it works perfectly, but if I lower the TF the signals change....can anybody tell me how to make the signal appear on the close of the 1hour candle even on a lower TF chart ? Is that possible ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #913 (permalink)  
Old 01-14-2008, 01:58 AM
ralph.ronnquist's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 280
ralph.ronnquist is on a distinguished road
Quote:
Originally Posted by MFM View Post
Hi there,
I created my first indicator and really happy about it. What I have is a 2map (1hour and daily) for trading only with the major trend.

On the 1hour chart it works perfectly, but if I lower the TF the signals change....can anybody tell me how to make the signal appear on the close of the 1hour candle even on a lower TF chart ? Is that possible ?
As usual, you can only discover bar opening, i.e. that it is the first tick on a new bar, and then you can use a predicate like the following:
PHP Code:
bool atHourBarOpen()
{
    if ( 
TimeCurrent() != Time[0] )
        return( 
false ); // Not the first tick of the bar
    
return( TimeHourTime[1] ) != TimeHourTime[0] ) );

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #914 (permalink)  
Old 01-14-2008, 10:32 AM
MFM MFM is offline
Junior Member
 
Join Date: May 2007
Posts: 11
MFM is on a distinguished road
Quote:
Originally Posted by ralph.ronnquist View Post
As usual, you can only discover bar opening, i.e. that it is the first tick on a new bar, and then you can use a predicate like the following:
PHP Code:
bool atHourBarOpen()
{
    if ( 
TimeCurrent() != Time[0] )
        return( 
false ); // Not the first tick of the bar
    
return( TimeHourTime[1] ) != TimeHourTime[0] ) );

thanks for your help, but i can't get my head around the issue. I am attacching the indicator, if you could have a look at it I would appreciate it very much. Would it be possible to have the signal come on the close of the TF specified in First_Map and not hard conditioned on the 1hr? This way if I change the TF in first map it will work on that one.
Attached Files
File Type: mq4 # 0 my test_ooops_Abcd.mq4 (8.4 KB, 6 views)

Last edited by MFM; 01-14-2008 at 12:12 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #915 (permalink)  
Old 01-15-2008, 06:32 AM
Junior Member
 
Join Date: Sep 2007
Posts: 23
Sendra is on a distinguished road
Putz

Hi, Putz,

Try to use GlobalVariable and iHigh()/iLow().

Maybe like this:

//---- input parameters

string ChangeTrendBar;

int start()

double H1=iHigh(NULL,0,1);
double H0=iHigh(NULL,0,0);
...
if(xnow>ynow && xprevious<yprevious) // signal that trend has change
{
GlobalVariableSet("BarTrendChange",Time[0]);
}

if(GlobalVariableGet("BarTrendChange")==Time[1])
{
if(H1<H0 && H0-H1=n-pip)
...

Hope it works.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #916 (permalink)  
Old 01-15-2008, 07:04 AM
ANCOLL's Avatar
Senior Member
 
Join Date: Nov 2006
Location: Indonesia
Posts: 251
ANCOLL is on a distinguished road
How to put Expiration day on the indicator

Dear all trader,
I want to know how to put an expiration date in indicator or EA, so that it has an expiration days like picture below. What string code should be added in .mtq?

Thanks in advance.
Attached Images
File Type: jpg Expired-Indicator.jpg (60.2 KB, 133 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #917 (permalink)  
Old 01-15-2008, 08:50 AM
cja's Avatar
cja cja is online now
Senior Member
 
Join Date: Apr 2006
Posts: 579
cja is on a distinguished road
Date Expiry Code

Quote:
Originally Posted by ANCOLL View Post
Dear all trader,
I want to know how to put an expiration date in indicator or EA, so that it has an expiration days like picture below. What string code should be added in .mtq?

Thanks in advance.
Hi ANCOLL

Good to hear from you again, I have just got back from the Christmas holidays and am ready to get back into it. I use this code I hope you find it works for you.

string Message="";

datetime expire = D'2008.02.04 12:00';

if (TimeCurrent()>expire){
Alert("Trial has ended. Please contact xxxx @ xxxx.com");
return(0);
}else {Message="Price Display Activated";}


ObjectDelete("Price_Account_Info");
ObjectCreate("Price_Account_Info", OBJ_LABEL,WindowFind("Price"), 0, 0);
ObjectSetText("Price_Account_Info",""+Message+" - Expires "+TimeToStr(expire)+"",8, "Tahoma", ForestGreen);
ObjectSet("Price_Account_Info", OBJPROP_CORNER, 3);
ObjectSet("Price_Account_Info", OBJPROP_XDISTANCE, 5);
ObjectSet("Price_Account_Info", OBJPROP_YDISTANCE, 5);





This code puts a message into the indicator window or chart window and an expiry into an Alert Box



Comment.gif



This example puts a message into the indicator window or chart window and an expiry into the top left of the chart



datetime expire = D'2008.02.04 13:25';

if (TimeCurrent()>expire){
Comment("Trial has ended. Please contact xxxx @ xxxx.com");
return(0);
}else {Message="Price Display Activated";}


ObjectDelete("Price_Account_Info");
ObjectCreate("Price_Account_Info", OBJ_LABEL,WindowFind("Price"), 0, 0);
ObjectSetText("Price_Account_Info",""+Message+" - Expires "+TimeToStr(expire)+"",8, "Tahoma", ForestGreen);
ObjectSet("Price_Account_Info", OBJPROP_CORNER, 3);
ObjectSet("Price_Account_Info", OBJPROP_XDISTANCE, 5);
ObjectSet("Price_Account_Info", OBJPROP_YDISTANCE, 5);




Comment1.gif

This next example puts both the messages into Comments on the top left of the chart.


datetime expire = D'2008.02.04 13:25';

if (TimeCurrent()>expire){
Comment("Trial has ended. Please contact xxxx @ xxxx.com");
return(0);
}else {Comment("Price Display Activated");}


All of these codes make the indicator disappear when the expiry time is up

A simple indicator as an example posted below

Price_Display.mq4

cja

Last edited by cja; 01-15-2008 at 08:56 AM. Reason: Added info
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #918 (permalink)  
Old 01-16-2008, 07:12 AM
Warren's Avatar
Junior Member
 
Join Date: Jan 2006
Posts: 9
Warren is on a distinguished road
Code - Disable EA on Friday's morning

Can someone help me with a piece of code which disable operation of EA exactly on Friday's morning, 8:00?

Thanks in advance,
Warren
__________________
Short Term Pain for Long Term Gain!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #919 (permalink)  
Old 01-16-2008, 09:53 AM
ANCOLL's Avatar
Senior Member
 
Join Date: Nov 2006
Location: Indonesia
Posts: 251
ANCOLL is on a distinguished road
Thanks cja for the code,
I am glad that you are always around to help
God bless..

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #920 (permalink)  
Old 01-16-2008, 01:06 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 986
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
PHP Code:
if(DayOfWeek()==&& TimeHour(TimeCurrent())==8) return(0); 
put this line into the start() function and before any line fo code!

Quote:
Originally Posted by Warren View Post
Can someone help me with a piece of code which disable operation of EA exactly on Friday's morning, 8:00?

Thanks in advance,
Warren
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
histogram, forex, ZUP_v1.mq4

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

LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/questions/270-ask.html
Posted By For Type Date
OzFx System:) - Page 639 This thread Refback 06-21-2008 10:53 PM
Forex SRDC Sidus Sibkis EA MT4 Forum OTCSmart This thread Refback 12-08-2007 12:46 PM


All times are GMT. The time now is 04:15 AM.



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