Forex



Go Back   Forex Trading > Training > Metatrader > Metatrader 4 mql 4 - Development course > Questions
Forex Forum Register More recent Blogs Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

Reply
 
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web 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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web 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: 297
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web 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, 18 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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #915 (permalink)  
Old 01-15-2008, 06:32 AM
Junior Member
 
Join Date: Sep 2007
Posts: 29
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web 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: 252
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, 159 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #917 (permalink)  
Old 01-15-2008, 08:50 AM
cja's Avatar
cja cja is offline
Senior Member
 
Join Date: Apr 2006
Posts: 676
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web 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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web 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: 252
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #920 (permalink)  
Old 01-16-2008, 01:06 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 994
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks

Tags
forex, histogram, JMASlope, ToR 1.20, ZUP_v1.mq4


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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


All times are GMT. The time now is 02:24 PM.



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