Forex
Google
New signals service!

Go Back   Forex Trading > Programming > Metatrader Programming


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
  #231 (permalink)  
Old 03-30-2007, 11:58 PM
Member
 
Join Date: Jan 2006
Posts: 30
DooMGuarD is on a distinguished road
Quote:
Originally Posted by BC Brett
Wish I had the answer.
I just finished writing my first EA and tried testing it in Strategy Tester.
I was getting errors showing in the ST journal so I tried using the Print function in my EA to debug the problems. I've worked out a few bugs so far this way, but it's a slow process.
in the metaeditor under edit menu exist "toggle breakpoint" <F9>... as to use breakpoint?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #232 (permalink)  
Old 04-12-2007, 04:43 PM
fxgrm's Avatar
Member
 
Join Date: Mar 2007
Posts: 91
fxgrm is on a distinguished road
Help with Crossed Alerts "SendMail" code?

Hi:

Would someone be willing to add "SendMail" code for trend reversal alerts to this indicator?

I would like to receive an email to my cell phone when the ema's cross so I don't have to sit in front of the computer all day long waitng for the next trend reversal (4 hr. charts).

I tried to do it myself but it sent repeated mass emails/text messages (very costly)

Thanks and Cheers!

Last edited by fxgrm; 09-22-2007 at 03:27 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #233 (permalink)  
Old 04-12-2007, 05:46 PM
Administrator
 
Join Date: Sep 2005
Posts: 16,817
Blog Entries: 145
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
Just for information:

- thread about email function (how to code) Email

- good article with some tool Collaboration Dolly + Isakas + Nina System
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #234 (permalink)  
Old 04-13-2007, 04:38 PM
mikep's Avatar
Member
 
Join Date: Jun 2006
Posts: 87
mikep is on a distinguished road
Code for Invisible TP and SL from Brokers

Hello Everyone,

With the paranoia of brokers hunting for SLs and widening spreads to avoid TPs, I'm looking for info on how to hide TP and SL from brokers.

I know that by submitting a TP and SL to the broker, in the event you're disconnected your order is "safe". While holding the info remotely, there is a danger of huge losses in the event the connection is lost.

Does anyone have an EA or example of code on how to keep TP and SL hidden from the broker?

Thanks!
Mike
__________________
--------------------------------------------------
"Treat people as if they were what they ought to be and help them become what they are capable of being." Goethe
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #235 (permalink)  
Old 04-15-2007, 12:13 PM
thesource's Avatar
Senior Member
 
Join Date: Dec 2006
Location: My World
Posts: 222
thesource is on a distinguished road
This EA has it

Hi MikeP

I think this EA contains what you are looking for. Please PM me if this is what you are looking for, I have another idea with this.
Attached Files
File Type: mq4 JLPiGrid.mq4 (7.3 KB, 66 views)
__________________
Safe Trades

the source
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #236 (permalink)  
Old 04-25-2007, 04:48 AM
Senior Member
 
Join Date: Feb 2007
Posts: 947
FerruFx is on a distinguished road
Help for simplify a piece of code

Hi there!

I am not a pro coder (see below!). This code work fine but is it possible to simplify it? With a while/for cycle for example? I wish the lightest code! This one is very "heavy" and I get the "internal stack overflow-simplify the program, please" error!!!

It's an indicator in a separate window.

In the example code, it displays the up or down for MA for multi TF.

Thanks for your help.

Code:
int start()
{
string MAfast_Trend_1, MAfast_Trend_5, MAfast_Trend_15;
double x;
color color_indic;
 
// period M1

double FastMA_1_1 = iMA(NULL,PERIOD_M1,FastMAPeriod,0,MAMethod,MAPrice,MAShift);
double FastMA_2_1 = iMA(NULL,PERIOD_M1,FastMAPeriod,0,MAMethod,MAPrice,MAShift+1);
   
if ((FastMA_1_1 > FastMA_2_1)) { MAfast_Trend_1 = "UP"; x = 256; color_indic = Lime; }
if ((FastMA_1_1 < FastMA_2_1)) { MAfast_Trend_1 = "DOWN"; x = 246; color_indic = Red; }

ObjectCreate("Trend_MAfast_1", OBJ_LABEL, WindowFind("xxxxxxx"), 0, 0);
ObjectSetText("Trend_MAfast_1",MAfast_Trend_1,7, "Verdana", color_indic);
ObjectSet("Trend_MAfast_1", OBJPROP_CORNER, 0);
ObjectSet("Trend_MAfast_1", OBJPROP_XDISTANCE, x);
ObjectSet("Trend_MAfast_1", OBJPROP_YDISTANCE, 22);

// period M5
   
double FastMA_1_5 = iMA(NULL,PERIOD_M5,FastMAPeriod,0,MAMethod,MAPrice,MAShift);
double FastMA_2_5 = iMA(NULL,PERIOD_M5,FastMAPeriod,0,MAMethod,MAPrice,MAShift+1);
   
if ((FastMA_1_5 > FastMA_2_5)) { MAfast_Trend_5 = "UP"; x = 256; color_indic = Lime; }
if ((FastMA_1_5 < FastMA_2_5)) { MAfast_Trend_5 = "DOWN"; x = 246; color_indic = Red; }

ObjectCreate("Trend_MAfast_5", OBJ_LABEL, WindowFind("xxxxxxx"), 0, 0);
ObjectSetText("Trend_MAfast_5",MAfast_Trend_5,7, "Verdana", color_indic);
ObjectSet("Trend_MAfast_5", OBJPROP_CORNER, 0);
ObjectSet("Trend_MAfast_5", OBJPROP_XDISTANCE, x);
ObjectSet("Trend_MAfast_5", OBJPROP_YDISTANCE, 37);

// period M15
   
double FastMA_1_15 = iMA(NULL,PERIOD_M15,FastMAPeriod,0,MAMethod,MAPrice,MAShift);
double FastMA_2_15 = iMA(NULL,PERIOD_M15,FastMAPeriod,0,MAMethod,MAPrice,MAShift+1);
   
if ((FastMA_1_15 > FastMA_2_15)) { MAfast_Trend_15 = "UP"; x = 256; color_indic = Lime; }
if ((FastMA_1_15 < FastMA_2_15)) { MAfast_Trend_15 = "DOWN"; x = 246; color_indic = Red; }

ObjectCreate("Trend_MAfast_15", OBJ_LABEL, WindowFind("xxxxxxx"), 0, 0);
ObjectSetText("Trend_MAfast_15",MAfast_Trend_15,7, "Verdana", color_indic);
ObjectSet("Trend_MAfast_15", OBJPROP_CORNER, 0);
ObjectSet("Trend_MAfast_15", OBJPROP_XDISTANCE, x);
ObjectSet("Trend_MAfast_15", OBJPROP_YDISTANCE, 52);

etc ...............

return(0);
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #237 (permalink)  
Old 04-28-2007, 03:19 PM
Senior Member
 
Join Date: May 2006
Posts: 147
waltini is on a distinguished road
Code Help? One Trade Only per Candle

I am trying to restrict my ea to taking one trade only per candle. I am finding that in price spikes against the trend I am getting multiple losing trades as the indicators are lagging.

I have seen the code before but I cant find it. If anyone could point me to an ea which has the correct code or show me how it is done.

It is done in the UniversalMa ea but it is not that clear to me there.

Any help would be appreciated.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #238 (permalink)  
Old 04-28-2007, 04:29 PM
Administrator
 
Join Date: Sep 2005
Posts: 16,817
Blog Entries: 145
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
It is here Basic questions ...

I am collecting all the functions on this thread http://www.forex-tsd.com/general-dis...ing-forum.html
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #239 (permalink)  
Old 04-28-2007, 10:29 PM
Senior Member
 
Join Date: May 2006
Posts: 147
waltini is on a distinguished road
Thanks Again

Hi NewDigital, as always thanks for your prompt reply.

cheers
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #240 (permalink)  
Old 05-13-2007, 05:58 AM
ryanklefas's Avatar
Senior Member
 
Join Date: Apr 2006
Location: USA
Posts: 439
ryanklefas is on a distinguished road
Here's a few ways to simplify your code:

REPLACE INDIVIDUAL INDICATOR VALUES WITH FUNCTION

double FastMA_1_5 = iMA(NULL,PERIOD_M5,FastMAPeriod,0,MAMethod,MAPrice ,MAShift);
double FastMA_1_15 = iMA(NULL,PERIOD_M15,FastMAPeriod,0,MAMethod,MAPric e,MAShift);

.... turn into this with an added function

maVal(5,1);
maVal(15,1);


THE FUNCTION THEY ARE CALLING IS BELOW:

double maVal(int tf, int shift)
{
return ( iMA(NULL,tf,FastMAPeriod,0,MAMethod,MAPrice,shift) );
}


* * * * * * * * * * * * * * * * * * * * * * * *

Also replace other individual variables that you have like the string variables with a string array. Arrays will work very nicely in loops and will simplify your code because you have fewer declarations to make.

string MAfast_Trend_1, MAfast_Trend_5, MAfast_Trend_15;

.... becomes this.....

string MAfast_Trend [3];
__________________
"Don't work harder, work smarter." -- my Java professor

Coder for Hire:
http://www.firecell-fx.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
candle time, CHinGsMAroonCLK, coders guru, expert advisor, forex, how to code, I_XO_A_H, mechanical trading, trading

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/metatrader-programming/554-how-code.html
Posted By For Type Date
Need an experienced programmer? - Page 2 Post #0 Refback 09-24-2008 07:24 AM

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to code this? iscuba11 Metatrader 4 mql 4 - Development course 1 08-03-2007 05:22 PM


All times are GMT. The time now is 12:07 PM.



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