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
  #571 (permalink)  
Old 12-14-2007, 04:39 AM
Senior Member
 
Join Date: Sep 2007
Posts: 310
jturns23 is on a distinguished road
This EA wont even compile, stoploss should be the lest of your concerns. There are 5 Variables that have random spaces in them or the first letter isn't capitalized!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #572 (permalink)  
Old 12-14-2007, 05:52 AM
Member
 
Join Date: Nov 2006
Posts: 94
tiger_wong is on a distinguished road
Quote:
Originally Posted by jturns23 View Post
This EA wont even compile, stoploss should be the lest of your concerns. There are 5 Variables that have random spaces in them or the first letter isn't capitalized!
Here the fix version.
But this still can't open any position because there is no logic in the code for decide how to open long / short positions.
Attached Files
File Type: mq4 CHinGs73MAroon73CLK200_v2.6.mq4 (7.4 KB, 30 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #573 (permalink)  
Old 12-14-2007, 09:56 AM
Member
 
Join Date: Feb 2007
Posts: 74
BigBoppa is on a distinguished road
I would like to ask how to make an ea draw a simple line in the chart-window (like a TrailingStop). I donīt want an indikator, just the ea itself (MT4).
Is this possible?

Thank You,

Stefan
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #574 (permalink)  
Old 12-15-2007, 11:14 AM
Junior Member
 
Join Date: Dec 2007
Posts: 6
Slakerz is on a distinguished road
Help with this EA

Quote:
Originally Posted by Michel View Post
Who is this CHinGsMAroonCLK ?
As I remember, this EA is nothing else than 10p3 from elCactus, but maybe I am wrong...
Check it's thread, you will probably find what you are looking for: http://www.forex-tsd.com/expert-advi...nts-3-mq4.html
Ok.. so now the thing is i can'y put a stoploss for this EA.. whats the code? can help me? thanx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #575 (permalink)  
Old 12-16-2007, 12:43 AM
Junior Member
 
Join Date: Apr 2007
Posts: 1
nash15 is on a distinguished road
none trading zone - code help

Hello everyone,

I trying to tweak a code but after much effort I still couldn't get it right.. if any of you guys dont mind can you have a look at this.. appreciate..

The idea is to stop the next trade if the price range is in the same zone as the previous trade. Long trade will check zone for last OPEN POSITION long trade, and short trade will check zone for last OPEN POSITION short trade.

ie. if the first LONG at 1.4000, then the second LONG will only trigger if the price move out of the zone (20 pips zone) less than 1.3990 && more than 1.4010



Thanks everyone..




//+------------------------------------------------------------------------------------------------------------------------+
//| Filter for sideways market - preventing multiple trade in similar price range and create no-trade zone |
//+------------------------------------------------------------------------------------------------------------------------+


extern int Zone1 = -10; // (lower zone)
extern int Zone2 = 10; // (upper zone)

// no trade zone between -10 and +10 from the previous trade



bool CheckZone(int type)
{
int cnt = OrdersTotal();
for (int i=0; i < cnt; i++)
{
if (!OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) continue;
if (OrderSymbol() != Symbol()) continue;
if (OrderMagicNumber() != Magic) continue;

if (OrderType() != type) continue;

if (type == OP_BUY)
{
if( (Bid - OrderOpenPrice()) > Zone1*Point && (Bid - OrderOpenPrice()) < Zone2*Point ) return(false);
}

if (type == OP_SELL)
{
if( (OrderOpenPrice()-Ask) > Zone1*Point && (OrderOpenPrice()-Ask) < Zone2*Point ) return(false);

}
}

return (true);
}

Last edited by nash15; 12-16-2007 at 12:53 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #576 (permalink)  
Old 12-17-2007, 09:46 PM
arsenic786's Avatar
Member
 
Join Date: Mar 2007
Posts: 86
arsenic786 is on a distinguished road
Thumbs up Resolve The EA Problem

Hello there all MQL Programmers,

Please check the following code and tell me why this is not placing the trades at my demo account. Its good EA on GJ 1m but unfortunately its not working. Can anyone fix it please and make it usable as a bug free EA.

I am thankfully in advance!
Best Regards.

//+------------------------------------------------------------------+
extern int Length1 = 3;
extern int Length2 = 10;
extern int Length3 = 16;


double Histo[];
double MaHisto[];

double up[];
double dn[];

double upMode[];
double dnMode[];

int alertBar;

int init()
{
return(0);
}

int deinit()
{
return(0);
}

int start()
{
int limit;
int counted_bars=IndicatorCounted();
if(counted_bars<0) counted_bars=0;
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;

for(int i = 0 ;i <= limit ;i++)Histo[i] = iMA(Symbol(),0,Length1,0,MODE_EMA,PRICE_CLOSE,i) - iMA(Symbol(),0,Length2,0,MODE_EMA,PRICE_CLOSE,i);

for(int j = 0 ;j <= limit ;j++)MaHisto[j] = iMAOnArray(Histo,0,Length3,0,MODE_EMA,j);

for(int m = 0 ;m <= limit ;m++)
{
if(MaHisto[m+1] <= 0 && MaHisto[m]> 0)
{
up[m] = Open[m]-(5*Point);

if(Bars > alertBar && m == 0)
{
//Alert(Symbol()+" "+Period()+" KI LONG ",Ask);
OrderSend(Symbol(),OP_BUY,0.1,Ask,3,25,15,0,0,0,Re d);
alertBar = Bars;
}
}
else if(MaHisto[m+1] >= 0 && MaHisto[m]< 0)
{
dn[m] = Open[m]+(5*Point);

if(Bars > alertBar && m == 0)
{
OrderSend(Symbol(),OP_SELL,0.1,Ask,3,25,15,0,0,0,R ed);
alertBar = Bars;
}
}
else
{
up[m] = EMPTY_VALUE;
dn[m] = EMPTY_VALUE;
}



if( MaHisto[m] > 0 )
{
upMode[m] = High[m];
dnMode[m] = Low[m];
}
else if( MaHisto[m] < 0 )
{
dnMode[m] = High[m];
upMode[m] = Low[m];
}

}
return(0);
}

//+------------------------------------------------------------------+
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #577 (permalink)  
Old 12-17-2007, 10:02 PM
Senior Member
 
Join Date: Feb 2006
Posts: 559
Michel is on a distinguished road
Quote:
Originally Posted by arsenic786 View Post
Hello there all MQL Programmers,

Please check the following code and tell me why this is not placing the trades at my demo account. Its good EA on GJ 1m but unfortunately its not working. Can anyone fix it please and make it usable as a bug free EA.

I am thankfully in advance!
Best Regards.

//+------------------------------------------------------------------+
extern int Length1 = 3;
extern int Length2 = 10;
extern int Length3 = 16;


double Histo[];
double MaHisto[];

double up[];
double dn[];

double upMode[];
double dnMode[];

int alertBar;

int init()
{
return(0);
}

int deinit()
{
return(0);
}

int start()
{
int limit;
int counted_bars=IndicatorCounted();
if(counted_bars<0) counted_bars=0;
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;

for(int i = 0 ;i <= limit ;i++)Histo[i] = iMA(Symbol(),0,Length1,0,MODE_EMA,PRICE_CLOSE,i) - iMA(Symbol(),0,Length2,0,MODE_EMA,PRICE_CLOSE,i);

for(int j = 0 ;j <= limit ;j++)MaHisto[j] = iMAOnArray(Histo,0,Length3,0,MODE_EMA,j);

for(int m = 0 ;m <= limit ;m++)
{
if(MaHisto[m+1] <= 0 && MaHisto[m]> 0)
{
up[m] = Open[m]-(5*Point);

if(Bars > alertBar && m == 0)
{
//Alert(Symbol()+" "+Period()+" KI LONG ",Ask);
OrderSend(Symbol(),OP_BUY,0.1,Ask,3,25,15,0,0,0,Re d);
alertBar = Bars;
}
}
else if(MaHisto[m+1] >= 0 && MaHisto[m]< 0)
{
dn[m] = Open[m]+(5*Point);

if(Bars > alertBar && m == 0)
{
OrderSend(Symbol(),OP_SELL,0.1,Ask,3,25,15,0,0,0,R ed);
alertBar = Bars;
}
}
else
{
up[m] = EMPTY_VALUE;
dn[m] = EMPTY_VALUE;
}



if( MaHisto[m] > 0 )
{
upMode[m] = High[m];
dnMode[m] = Low[m];
}
else if( MaHisto[m] < 0 )
{
dnMode[m] = High[m];
upMode[m] = Low[m];
}

}
return(0);
}

//+------------------------------------------------------------------+
"OrderSend(Symbol(),OP_SELL,0.1,Ask,3,25,15,0,0,0, R ed); "
You are selling at the Ask price, should be Bid.
The Comment field should be "", not 0.
25 as SL should be Bid+25*Point.
15 as TP should be Bid-15*Point.
"R ed" is not a color.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #578 (permalink)  
Old 12-17-2007, 10:26 PM
arsenic786's Avatar
Member
 
Join Date: Mar 2007
Posts: 86
arsenic786 is on a distinguished road
Angry

Quote:
Originally Posted by Michel View Post
"OrderSend(Symbol(),OP_SELL,0.1,Ask,3,25,15,0,0,0, R ed); "
You are selling at the Ask price, should be Bid.
The Comment field should be "", not 0.
25 as SL should be Bid+25*Point.
15 as TP should be Bid-15*Point.
"R ed" is not a color.

Thank you very much for your support!

But, I am still facing problems zero knowledge of MQL. Can you please copy paste the code in mq4 file and test it on demo and then tell me if it works fine. Your support will be counted as Kindest Help Michel.

Best Regards,
Kashif.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #579 (permalink)  
Old 12-17-2007, 11:04 PM
Senior Member
 
Join Date: Feb 2006
Posts: 559
Michel is on a distinguished road
No, sorry, I do not have enough time for now.
In few hours I take a boat to go back to my family for Xmas ... and no more pc...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #580 (permalink)  
Old 12-18-2007, 03:45 PM
Junior Member
 
Join Date: Oct 2007
Posts: 1
assasin is on a distinguished road
Hi all..

how can i set an order code in metaeditor,

i use demo account ... is it possible to set an order in demo account
i tried it but it failed
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:11 PM.



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