Forex
Google

Go Back   Forex Trading > Metatrader Training > Metatrader 4 mql 4 - Development course > Questions
Forex Forum Register FAQ Members List Calendar Today's Posts


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
  #1091 (permalink)  
Old 05-15-2008, 03:40 AM
saintmo saintmo is offline
Senior Member
 
Join Date: Aug 2006
Posts: 180
saintmo is on a distinguished road
Quote:
Originally Posted by WNW View Post
Thanks for your reply, but you're right, they're not exactly what I'm looking for.
I don't have the code savvy yet to address the problem.

I need the code to return the "high watermark" of the account balance.

Thanks again, any help appreciated.
WNW,

I hope this is not too simplistic nor misunderstanding your needs, but have you considered using a global variable for your "high watermark" of the account balance. The initial global variable balance is set to your current account balance. Then when your account balance is greater than your global account balance (saved) you can perform whatever action you choose and then save the new higher balance to the global variable. The highest account balance is always saved to the global variable and used to test against the newest account balance. Additionally, if the EA terminates from loss of internet connection, etc, the highest balance is still available within the global variable.

saintmo
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1092 (permalink)  
Old 05-15-2008, 06:59 AM
FerruFx FerruFx is offline
Senior Member
 
Join Date: Feb 2007
Posts: 542
FerruFx is on a distinguished road
Quote:
Originally Posted by sonicdeejay View Post
How can I write a code to make the EA not to trade during certain period (e.g 01:00 GMT 0 - 06:00 GMT 0), even there is a buy/sell signal??
Here's a way to code a time filter:

Quote:
extern bool Use.Time.Filter = false;
extern string Server.Time.To.Start = "00:00";
extern string Server.Time.To.Stop = "00:00";

datetime start_time,end_time;
Then:

Quote:
//---- Time period calculation
start_time = StrToTime(TimeToStr(TimeCurrent(), TIME_DATE) + " " + Server.Time.To.Start); //---- Date and time to start
end_time = StrToTime(TimeToStr(TimeCurrent(), TIME_DATE) + " " + Server.Time.To.Stop); //---- Date and time to stop

//---- Is it time to trade
if(Use.Time.Filter && (TimeCurrent() < start_time || TimeCurrent() >= end_time)) return(0);
FerruFx
__________________
THE HEART of FOREX & THE PROBABILITY METER - Trade with 100% confidence and ... Stress Less!!!
Coding services: Experts Advisors, indicators, alerts, etc ... more info by PM
NEW: video presentation of the Probability Meter ... 24hrs action on the website
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1093 (permalink)  
Old 05-16-2008, 09:32 AM
sonicdeejay's Avatar
sonicdeejay sonicdeejay is offline
Member
 
Join Date: Apr 2008
Posts: 82
sonicdeejay is on a distinguished road
Quote:
Originally Posted by FerruFx View Post
Here's a way to code a time filter:



Then:



FerruFx
U r t man!!
can u help me put that function in the following EA??

sonic
Attached Files
File Type: mq4 Sonic_EA_v2.mq4 (10.3 KB, 7 views)
__________________
~It's not who I am underneath but, what I do that defines me!!

My FOREX Journal
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1094 (permalink)  
Old 05-16-2008, 11:03 AM
FerruFx FerruFx is offline
Senior Member
 
Join Date: Feb 2007
Posts: 542
FerruFx is on a distinguished road
Quote:
Originally Posted by sonicdeejay View Post
U r t man!!
can u help me put that function in the following EA??

sonic
I put it inside but very quick (I am little bit busy ). Please check if it works.

FerruFx
Attached Files
File Type: mq4 Sonic_EA_v2.mq4 (11.1 KB, 15 views)
__________________
THE HEART of FOREX & THE PROBABILITY METER - Trade with 100% confidence and ... Stress Less!!!
Coding services: Experts Advisors, indicators, alerts, etc ... more info by PM
NEW: video presentation of the Probability Meter ... 24hrs action on the website
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1095 (permalink)  
Old 05-17-2008, 05:56 AM
sonicdeejay's Avatar
sonicdeejay sonicdeejay is offline
Member
 
Join Date: Apr 2008
Posts: 82
sonicdeejay is on a distinguished road
Quote:
Originally Posted by FerruFx View Post
I put it inside but very quick (I am little bit busy ). Please check if it works.

FerruFx
thx u, SIr,,,

can u help me put in the display (the last part of the code, comment session) saying the EA is actively looking for a trade or disabled??

sonic
__________________
~It's not who I am underneath but, what I do that defines me!!

My FOREX Journal
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1096 (permalink)  
Old 05-17-2008, 07:04 AM
bt062 bt062 is offline
Junior Member
 
Join Date: Nov 2007
Posts: 4
bt062 is on a distinguished road
MA as support & resistent

i heart that codersguru like MA, so some simple request.
so can you make MA as support and resistent, not only to show the trend.
because used it as support and resistent so we can make as a breakout so we can make it as an early warning about the end of the trend, is about to revest
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1097 (permalink)  
Old 05-17-2008, 08:20 AM
FerruFx FerruFx is offline
Senior Member
 
Join Date: Feb 2007
Posts: 542
FerruFx is on a distinguished road
Quote:
Originally Posted by sonicdeejay View Post
thx u, SIr,,,

can u help me put in the display (the last part of the code, comment session) saying the EA is actively looking for a trade or disabled??

sonic
Here's for the comment.

FerruFx
Attached Files
File Type: mq4 Sonic_EA_v2-1.mq4 (11.4 KB, 17 views)
__________________
THE HEART of FOREX & THE PROBABILITY METER - Trade with 100% confidence and ... Stress Less!!!
Coding services: Experts Advisors, indicators, alerts, etc ... more info by PM
NEW: video presentation of the Probability Meter ... 24hrs action on the website
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1098 (permalink)  
Old 05-19-2008, 02:17 PM
linalm linalm is offline
Junior Member
 
Join Date: Feb 2008
Posts: 4
linalm is on a distinguished road
Question Help please ... iStochastics returns values different from those on the chart

Hi everyone,

I am running into some issues using the iStochastic function and would like your assistance. The values that I get do not match those that I see on the chart. What could the reason be and how can I solve this? I am running the following code in an indicator attached to a M15 chart:


trendTF=PERIOD_H4;
...
curStoch =iStochastic(NULL,trendTF,10,3,3,MODE_SMA,0,MODE_M AIN,i);
curStochSignal =iStochastic(NULL,trendTF,10,3,3,MODE_SMA,0,MODE_S IGNAL,i);
prevStoch =iStochastic(NULL,trendTF,10,3,3,MODE_SMA,0,MODE_M AIN,i+1);
prevStochSignal =iStochastic(NULL,trendTF,10,3,3,MODE_SMA,0,MODE_S IGNAL,i+1);

I appreciate your assistance and thank you in advance.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1099 (permalink)  
Old 05-20-2008, 12:59 AM
FerruFx FerruFx is offline
Senior Member
 
Join Date: Feb 2007
Posts: 542
FerruFx is on a distinguished road
Quote:
Originally Posted by linalm View Post
Hi everyone,

I am running into some issues using the iStochastic function and would like your assistance. The values that I get do not match those that I see on the chart. What could the reason be and how can I solve this? I am running the following code in an indicator attached to a M15 chart:


trendTF=PERIOD_H4;
...
curStoch =iStochastic(NULL,trendTF,10,3,3,MODE_SMA,0,MODE_M AIN,i);
curStochSignal =iStochastic(NULL,trendTF,10,3,3,MODE_SMA,0,MODE_S IGNAL,i);
prevStoch =iStochastic(NULL,trendTF,10,3,3,MODE_SMA,0,MODE_M AIN,i+1);
prevStochSignal =iStochastic(NULL,trendTF,10,3,3,MODE_SMA,0,MODE_S IGNAL,i+1);

I appreciate your assistance and thank you in advance.
I see that a specific timeframe (trendTF) is coded. Do you watch the same TF to compare with the results?

FerruFx
__________________
THE HEART of FOREX & THE PROBABILITY METER - Trade with 100% confidence and ... Stress Less!!!
Coding services: Experts Advisors, indicators, alerts, etc ... more info by PM
NEW: video presentation of the Probability Meter ... 24hrs action on the website
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1100 (permalink)  
Old 05-20-2008, 04:57 AM
sonicdeejay's Avatar
sonicdeejay sonicdeejay is offline
Member
 
Join Date: Apr 2008
Posts: 82
sonicdeejay is on a distinguished road
Quote:
Originally Posted by FerruFx View Post
Here's for the comment.

FerruFx
FerruFx & guru,,

pls refer to t attached....

TIme Filter setting is working well

Quote:
start_time = StrToTime(TimeToStr(TimeCurrent(), TIME_DATE) + " " + Server.Time.To.Start); //---- Date and time to start
end_time = StrToTime(TimeToStr(TimeCurrent(), TIME_DATE) + " " + Server.Time.To.Stop); //---- Date and time to stop
if(Use.Time.Filter)
{
if(TimeHour(TimeCurrent())>=Server.Time.To.Start || TimeHour(TimeCurrent())<=Server.Time.To.Stop)
{
HourT = 1;
}
else
{
HourT = 0;// If the time is not within the set peroid, EA will change to mode 2,which only manage t trade
EA_Mode = 2;
}
}


but, the diplay of the status is not...
Quote:
if(!Use.Time.Filter) com = "Off";

if(Use.Time.Filter&&HourT==1)com = "Active";
if(Use.Time.Filter&&HourT==0)com = "Standby";


thx

sonic
Attached Files
File Type: mq4 SonicStriker_EA_v2.0.mq4 (11.8 KB, 13 views)
__________________
~It's not who I am underneath but, what I do that defines me!!

My FOREX Journal

Last edited by sonicdeejay : 05-20-2008 at 05:02 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



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

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 09:53 PM
Forex SRDC Sidus Sibkis EA MT4 Forum OTCSmart This thread Refback 12-08-2007 11:46 AM


All times are GMT. The time now is 12:50 AM.