Forex
Google

Go Back   Forex Trading > Metatrader Training > Metatrader 4 mql 4 - Development course > Questions
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 (1) Thread Tools Display Modes
  #1081 (permalink)  
Old 05-03-2008, 03:51 PM
Dave137 Dave137 is offline
Senior Member
 
Join Date: Oct 2007
Posts: 141
Dave137 is on a distinguished road
Smile

Thank you Michel for the proper fix to my triple Trailing Stop coding. This will hopefully put the final fix to my new ea creation. Without the generosity of everybody's knowledge, I would not of been able to program this language. I keep notes on all the new information I acquire on this language. I hope when MT5 gets introduced, the coding will not change to radically - I would hate to start all over again! Thanks again!!

Dave
<><<<
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1082 (permalink)  
Old 05-03-2008, 04:05 PM
Dave137 Dave137 is offline
Senior Member
 
Join Date: Oct 2007
Posts: 141
Dave137 is on a distinguished road
Smile

Quote:
Originally Posted by solamax View Post



Can I ask anybody to have a look at my code to see where it's wrong please....I am not much of a programmer and would appreciate some assistance with this.


many thanks in advance

also i just realized something - theres a guy called Ben Taylor selling an EA that looks almost exactly like the one that coder's guru programmed - maybe thats one of his clients - lol

if its not - we should let coders guru know about this
PHP Code:
double Buy2_1 iOpen(NULL0Current 0); //Statement in question for crossover!
double Buy2_2 iMA(NULL0500MODE_EMAPRICE_CLOSECurrent 0); 
If I had to zero into a problem area, it would be this code above. There needs to be a cross over for a buy and a sell.

double Buy1_1 = iMA(NULL, 0, 5, 0, MODE_EMA, PRICE_CLOSE, Current + 0);
double Buy1_2 = iMA(NULL, 0, 5, 0, MODE_EMA, PRICE_CLOSE, Current + 1); //1-Back
double Buy2_1 = iMA(NULL, 0, 50, 0, MODE_EMA, PRICE_CLOSE, Current + 0);
double Buy2_2 = iMA(NULL, 0, 50, 0, MODE_EMA, PRICE_CLOSE, Current + 1); //1-Back

double Sell1_1 = iMA(NULL, 0, 5, 0, MODE_EMA, PRICE_CLOSE, Current + 0);
double Sell1_2 = iMA(NULL, 0, 5, 0, MODE_EMA, PRICE_CLOSE, Current + 1); //1-Back
double Sell2_1 = iMA(NULL, 0, 50, 0, MODE_EMA, PRICE_CLOSE, Current + 0);
double Sell2_2 = iMA(NULL, 0, 50, 0, MODE_EMA, PRICE_CLOSE, Current + 1); //1-Back

if(Buy1_1>Sell2_1 && Buy1_2<Sell2_2) Then Buy; // Proper 'UP' crossover has occurred!
if(Sell1_1<Buy2_1 && Sell1_2>Buy2_2) Then Sell; // Proper 'DOWN' crossover has occurred!

Dave

Last edited by Dave137 : 05-03-2008 at 04:40 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1083 (permalink)  
Old 05-03-2008, 08:52 PM
WNW's Avatar
WNW WNW is offline
Senior Member
 
Join Date: Feb 2006
Location: Motown, USA
Posts: 368
WNW is on a distinguished road
Coding help needed

Any help appreciated..

This would go in an EA as a component of the trade-closure routine.

I need to create a variable that always returns the highest historic balance of the account. I think this would require an array?

In practical terms, the language would be saying. "if my open profit is X-pips higher than the all-time high balance in the account, close all trades."

If someone can help with the variable I think I can code the rest.

Thanks in advance.

Last edited by WNW : 05-04-2008 at 04:42 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1084 (permalink)  
Old 05-04-2008, 02:05 AM
Dave137 Dave137 is offline
Senior Member
 
Join Date: Oct 2007
Posts: 141
Dave137 is on a distinguished road
Smile

This is not quite what you are looking for, but look it over anyway. Attach to another graph and it monitors all profit, loss from graphs that have working ea's on them.
Attached Files
File Type: mq4 AccountMonitor.mq4 (2.3 KB, 13 views)
File Type: mq4 EquityMangager V2.mq4 (2.5 KB, 7 views)
File Type: doc Close all orders if Equity Increases by 10.doc (21.0 KB, 7 views)

Last edited by Dave137 : 05-04-2008 at 02:15 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1085 (permalink)  
Old 05-04-2008, 03:09 AM
solamax's Avatar
solamax solamax is offline
Junior Member
 
Join Date: Apr 2008
Posts: 12
solamax is on a distinguished road
Thumbs up Dave - you're a blessing:)

Quote:
Originally Posted by Dave137 View Post
PHP Code:
double Buy2_1 iOpen(NULL0Current 0); //Statement in question for crossover!
double Buy2_2 iMA(NULL0500MODE_EMAPRICE_CLOSECurrent 0); 
If I had to zero into a problem area, it would be this code above. There needs to be a cross over for a buy and a sell.

double Buy1_1 = iMA(NULL, 0, 5, 0, MODE_EMA, PRICE_CLOSE, Current + 0);
double Buy1_2 = iMA(NULL, 0, 5, 0, MODE_EMA, PRICE_CLOSE, Current + 1); //1-Back
double Buy2_1 = iMA(NULL, 0, 50, 0, MODE_EMA, PRICE_CLOSE, Current + 0);
double Buy2_2 = iMA(NULL, 0, 50, 0, MODE_EMA, PRICE_CLOSE, Current + 1); //1-Back

double Sell1_1 = iMA(NULL, 0, 5, 0, MODE_EMA, PRICE_CLOSE, Current + 0);
double Sell1_2 = iMA(NULL, 0, 5, 0, MODE_EMA, PRICE_CLOSE, Current + 1); //1-Back
double Sell2_1 = iMA(NULL, 0, 50, 0, MODE_EMA, PRICE_CLOSE, Current + 0);
double Sell2_2 = iMA(NULL, 0, 50, 0, MODE_EMA, PRICE_CLOSE, Current + 1); //1-Back

if(Buy1_1>Sell2_1 && Buy1_2<Sell2_2) Then Buy; // Proper 'UP' crossover has occurred!
if(Sell1_1<Buy2_1 && Sell1_2>Buy2_2) Then Sell; // Proper 'DOWN' crossover has occurred!

Dave
many thanks indeed - i will give it a go
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1086 (permalink)  
Old 05-04-2008, 04:49 AM
WNW's Avatar
WNW WNW is offline
Senior Member
 
Join Date: Feb 2006
Location: Motown, USA
Posts: 368
WNW is on a distinguished road
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.

Quote:
Originally Posted by Dave137 View Post
This is not quite what you are looking for, but look it over anyway. Attach to another graph and it monitors all profit, loss from graphs that have working ea's on them.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1087 (permalink)  
Old 05-06-2008, 10:06 AM
heartnet's Avatar
heartnet heartnet is offline
Senior Member
 
Join Date: Mar 2008
Posts: 101
heartnet is on a distinguished road
Trading Indicator

I want to request an alert for stoch like this.........
the alert looks like this......
coders can you make alert for this indicator.so when stoch 14,3,3 cross line 76.4,50,23.6 there will be pop up window that says"euro/usd stoch cross line 76.4 from up"
"gbp/jpy stoch cross line 76.4 from down""usd/jpy stoch cross line 23.6 from up""stoch cross line 23.6 from down"."gbp/chf stoch crossline 50 from up"
"."gbp/chf stoch crossline 50 from up"
with currency detail like above.maybe can be add is time frame details.
such"eur/usd 30min stoch cross 76.4 line from below"
can you make it and what i hope is not late signal means the alert is on time.
actually I have my desired alert....but its late in alert.. believe me its give late signal:
diamond:red when stoch cross 50 from up to down green cross up.
arrow red:cross down line 76.4 or 23.6
green arrow:cross up line 23.6 or 76.4
if you all(coders) think doesnt want to make a new one instead to fix this...tell me Ill upload the indicator..

p/s:the indicator also have pop up window...

check the photos...below
I also attach the indicator-for those who wants to fix it instead making new one
Attached Images
File Type: gif the problem.gif (57.7 KB, 83 views)
Attached Files
File Type: mq4 #Stochastic_Cross_Alert_23_6.mq4 (5.9 KB, 4 views)
File Type: mq4 #Stochastic_Cross_Alert_50.mq4 (5.9 KB, 1 views)
File Type: mq4 #Stochastic_Cross_Alert_76_4.mq4 (5.9 KB, 2 views)
__________________
My thread 30 tf
Not Ultimate but Simple-stoch based system-
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1088 (permalink)  
Old 05-06-2008, 10:09 AM
heartnet's Avatar
heartnet heartnet is offline
Senior Member
 
Join Date: Mar 2008
Posts: 101
heartnet is on a distinguished road
Exclamation A Baby Trader.........

Quote:
Originally Posted by heartnet View Post
I want to request an alert for stoch like this.........
the alert looks like this......
coders can you make alert for this indicator.so when stoch 14,3,3 cross line 76.4,50,23.6 there will be pop up window that says"euro/usd stoch cross line 76.4 from up"
"gbp/jpy stoch cross line 76.4 from down""usd/jpy stoch cross line 23.6 from up""stoch cross line 23.6 from down"."gbp/chf stoch crossline 50 from up"
"."gbp/chf stoch crossline 50 from up"
with currency detail like above.maybe can be add is time frame details.
such"eur/usd 30min stoch cross 76.4 line from below"
can you make it and what i hope is not late signal means the alert is on time.
actually I have my desired alert....but its late in alert.. believe me its give late signal:
diamond:red when stoch cross 50 from up to down green cross up.
arrow red:cross down line 76.4 or 23.6
green arrow:cross up line 23.6 or 76.4
if you all(coders) think doesnt want to make a new one instead to fix this...tell me Ill upload the indicator..

p/s:the indicator also have pop up window...

check the photos...below
I also attach the indicator-for those who wants to fix it instead making new one
being remind that if you make new one or fix the older one please post it as indicator...so I can attach it easily..Im not a coder
__________________
My thread 30 tf
Not Ultimate but Simple-stoch based system-
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1089 (permalink)  
Old 05-15-2008, 02:23 AM
sonicdeejay's Avatar
sonicdeejay sonicdeejay is offline
Junior Member
 
Join Date: Apr 2008
Posts: 22
sonicdeejay is on a distinguished road
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??


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
  #1090 (permalink)  
Old 05-15-2008, 03:19 AM
jturns23 jturns23 is offline
Senior Member
 
Join Date: Sep 2007
Posts: 112
jturns23 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??


sonic
bool IsTradeTime(int begin, int end){
if(begin < end){
if(Hour() >= begin && Hour() < end)return(true);
} else {
if(Hour() >= begin || Hour() < end)return(true);
}
return(false);
}
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

LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/questions/270-ask.html
Posted By For Type Date
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 06:07 PM.