Forex
Google

Go Back   Forex Trading > Programming > Metatrader Programming
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 Thread Tools Display Modes
  #31 (permalink)  
Old 11-28-2006, 06:35 AM
iPlayGames iPlayGames is offline
Junior Member
 
Join Date: Nov 2005
Posts: 14
iPlayGames is on a distinguished road
MT4 file functions

hello, my Indicator uses the following code to record every trade signal to a text file. by default, the latest signal is the last record at the bottom of the file. what I want to do is to reverse this order. that is, I'd like my latest signal to come on top. does anybody know how to do this?


void Trade_Log(string type,string price,string sigBar)
{
//----
int handle = 0;
string log = "";
//----
log = type+"@"+price+" @ "+sigBar+" bars";
handle = FileOpen("lastSignal_.dat",FILE_BIN|FILE_READ|FILE _WRITE);
if(handle>0){ FileSeek(handle,0,SEEK_END);
FileWrite(handle,log);
FileClose(handle);
handle = 0;
}
//----
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #32 (permalink)  
Old 11-29-2006, 03:41 PM
matrixebiz's Avatar
matrixebiz matrixebiz is offline
Senior Member
 
Join Date: Oct 2006
Posts: 1,039
matrixebiz is on a distinguished road
Vertical scale

Any way to increase the size of the vertical scale numbers? I'm finding them hard to read somtimes


Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #33 (permalink)  
Old 11-30-2006, 02:45 PM
eooojj eooojj is offline
Member
 
Join Date: Aug 2006
Location: singapore
Posts: 40
eooojj is on a distinguished road
Help needed - How to code MQL 50% Trailing Stop?

Hi,
Thanks in advance.
Does anyone know the code MQL MT4 to incorporate a
50% Trailing Stop after profit has cross "x" pips?
Thanks thanks thanks.
ed

Last edited by eooojj : 12-02-2006 at 02:26 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #34 (permalink)  
Old 12-06-2006, 06:12 AM
iPlayGames iPlayGames is offline
Junior Member
 
Join Date: Nov 2005
Posts: 14
iPlayGames is on a distinguished road
regarding OrderTicket() function

I want my EA to check and make sure that it can only have one pending order in the pool at any one time, so I wrote the following code to do that:

int CheckOrders()
{
//----
int i,orders;
int tickets[];
//----
int ticket = 0;
int total = OrdersTotal();
//----
for(i=total;i>=0;i--) tickets[i] = 0;
//----
for(i=total;i>=0;i--){
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)){
if(OrderMagicNumber()==magic_base && OrderType()>1){
orders++;
tickets[i] = OrderTicket();
Print("tickets = ",tickets[i]);
}
}
}
Print("total = ",total," orders = ",orders);
while(orders>1){
for(i=total;i>=0;i--){
if(ticket==0 && tickets[i]>0) ticket = tickets[i];
if(ticket>tickets[i]) ticket = tickets[i];
}
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES )){
OrderDelete(ticket);
}
orders--;
}
Print("ticket = ",ticket);
//----
return(0);
}


It displays the number of pending orders in the pool by the same EA correctly, but it won't delete the unwanted pending orders, because it always shows that tickets[i] = 0. and because of this, the OrderDelete(ticket) won't work. Could sb please tell me why this would happen?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #35 (permalink)  
Old 12-08-2006, 03:30 PM
matrixebiz's Avatar
matrixebiz matrixebiz is offline
Senior Member
 
Join Date: Oct 2006
Posts: 1,039
matrixebiz is on a distinguished road
Please check, getting error

Hello, I'm trying this EA but getting this error;
unknown subwindow number 1 for ObjectCreate function

and

name parameter for ObjectDelete function must be a string

What does that mean?
Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #36 (permalink)  
Old 12-11-2006, 01:33 AM
dr2k3 dr2k3 is offline
Junior Member
 
Join Date: Oct 2006
Posts: 27
dr2k3 is on a distinguished road
Noobie need help

hi guys, could some one teach me how to stop EA from trading at news time?

sleep command thing, and how to add in to an existing EA without need to rewrite the whole thing....because i am dumb at reading code an writing code (using metatrader expert advisor builder)

sample of sleep command code in 1 line or only the related line only, dont do the whole EA/indicator and ask me to read...i don't know how to =/ sorry....

i tried many times try to read an EA, even using the metatrader dictionary thing, but alot of the code i saw in an EA isnt in the dictionary....and the dictionary isnt very specify...well atleast for me....

dummy proof please ><
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #37 (permalink)  
Old 12-15-2006, 05:01 AM
clam61 clam61 is offline
Senior Member
 
Join Date: Aug 2006
Posts: 150
clam61 is on a distinguished road
MT4 Text indicator? How to...

if i want to draw text on the screen, must it be an object? is there an indicator style for me to draw simple #s on the screen?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #38 (permalink)  
Old 12-18-2006, 02:03 AM
mhdeaton mhdeaton is offline
Junior Member
 
Join Date: Dec 2006
Posts: 11
mhdeaton is on a distinguished road
Resources for MQL4 writing ?

Any videos I can buy, or a complete book on the subject. I have various tutorials, but none very helpfull. Sure would be nice to look at a real EA with notes next to each line indicating exactly what the line means.

Also helpfull if one could get a tutorial on editing an EA, I think that would be the best way to learn, editing an EA to fit your style.

Thanks for any info...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #39 (permalink)  
Old 12-18-2006, 08:33 AM
newdigital newdigital is online now
Administrator
 
Join Date: Sep 2005
Posts: 15,388
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
Quote:
Originally Posted by mhdeaton
Any videos I can buy, or a complete book on the subject. I have various tutorials, but none very helpfull. Sure would be nice to look at a real EA with notes next to each line indicating exactly what the line means.

Also helpfull if one could get a tutorial on editing an EA, I think that would be the best way to learn, editing an EA to fit your style.

Thanks for any info...
Try to look at the following:

- mql4 development course;
- Templates to create EAs and Indicators;
- Codersguru lessons in his website;
- Trading the MetaTrader; Codersguru lessons.
- mql4 Metatrader development course;
- All Codersguru lessons in one ebook;
- mql4 starting and continuing.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #40 (permalink)  
Old 12-18-2006, 06:45 PM
mhdeaton mhdeaton is offline
Junior Member
 
Join Date: Dec 2006
Posts: 11
mhdeaton is on a distinguished road
cool thanks...

your link mql4 development course; doesnt seem to work can you fix it ?

Thanks again

Mhdeaton
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Learning Cycles For New Traders Dan7974 General Discussion 350 01-18-2008 06:04 PM
Learning to code for autotrading GoatT Metatrader Programming 8 01-10-2007 08:55 PM
Self learning expert mrtools Expert Advisors - Metatrader 4 32 10-22-2006 05:29 PM


All times are GMT. The time now is 11:06 AM.