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
  #471 (permalink)  
Old 11-07-2007, 05:04 AM
yyc196's Avatar
Senior Member
 
Join Date: Dec 2006
Location: Earth
Posts: 197
yyc196 is on a distinguished road
Cool Problem Solved

Hi,

I have solved my bug myself, a silly mistake made. Thanks all for reading this thread.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #472 (permalink)  
Old 11-07-2007, 12:36 PM
Junior Member
 
Join Date: Oct 2007
Posts: 7
makemo8 is on a distinguished road
Converted it yet?

Quote:
Originally Posted by Beno View Post
Thanks Mr Pips

Sorted it
Is it possible to turn this indicator into an EA. I thought Beno is trying to do this. I will appreciate anyone who has done it or can do it to please post the EA version of this indicator. Many thanks

The indicator is attached:
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #473 (permalink)  
Old 11-07-2007, 12:46 PM
Junior Member
 
Join Date: Oct 2007
Posts: 7
makemo8 is on a distinguished road
Quote:
Originally Posted by makemo8 View Post
Is it possible to turn this indicator into an EA. I thought Beno is trying to do this. I will appreciate anyone who has done it or can do it to please post the EA version of this indicator. Many thanks

The indicator is attached:
Oops! the indicator to be converted to an EA is MT4-LevelStop-Reverse-vB0-4.mq4
Attached Files
File Type: mq4 MT4-LevelStop-Reverse-vB0-4.mq4 (11.7 KB, 17 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #474 (permalink)  
Old 11-07-2007, 12:57 PM
judex001's Avatar
Junior Member
 
Join Date: May 2006
Posts: 13
judex001 is on a distinguished road
Hi,

I have a EA to trade breakout - each night, I have to load preset files with the breakouts levels for the next day.

My question is : How can I make the EA looks for the preset files himself instead of doing it myself ?

Example : I upload the presets files on a ftp, the ea know the adress and each day at 22:00, the presets files are loaded from this adress.

Is this possible ?

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #475 (permalink)  
Old 11-09-2007, 12:51 AM
Junior Member
 
Join Date: Nov 2007
Posts: 5
westofpluto is on a distinguished road
Programming questions

I have a couple quick questions:

1. Suppose I am trading GBPUSD on the 15 minute charts. Does the start() function in my EA get called only when a new bar becomes available (every 15 minutes) or is it every time there is a new quote (cane be every few seconds)?

2. Suppose at a specific time I place two orders - one is a buy stop say 20 pips above the current price and the other is a sell stop 20 pips below the current price. If the price goes up to my buy stop, I want to cancel the sell stop as soon as I confirm that the buy stop order was triggered. Similarly, if the price goes down to my sell stop, I want to cancel the buy stop as soon as I confirm that the sell stop was triggered.

So is there an easy way to do this? How do I confirm that the buy stop was triggered before canceling the sell stop? Does the system provide some sort of order callback function that lets me know an order was triggered? Or do I just have to let the start() function keep checking for open orders every quote and detect it that way?

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #476 (permalink)  
Old 11-09-2007, 04:17 AM
wolfe's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 723
wolfe is on a distinguished road
Quote:
Originally Posted by westofpluto View Post
I have a couple quick questions:

1. Suppose I am trading GBPUSD on the 15 minute charts. Does the start() function in my EA get called only when a new bar becomes available (every 15 minutes) or is it every time there is a new quote (cane be every few seconds)?

2. Suppose at a specific time I place two orders - one is a buy stop say 20 pips above the current price and the other is a sell stop 20 pips below the current price. If the price goes up to my buy stop, I want to cancel the sell stop as soon as I confirm that the buy stop order was triggered. Similarly, if the price goes down to my sell stop, I want to cancel the buy stop as soon as I confirm that the sell stop was triggered.

So is there an easy way to do this? How do I confirm that the buy stop was triggered before canceling the sell stop? Does the system provide some sort of order callback function that lets me know an order was triggered? Or do I just have to let the start() function keep checking for open orders every quote and detect it that way?

Thanks
1. Start() function is called at every tick

2. Yes it's possible. More than one way to do it. You could set your buy stop and sell stop, then call the OrderType( ) function, if it returns an OP_BUY or an OP_SELL , you could then use OrderDelete( ) to delete the existing pending order.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #477 (permalink)  
Old 11-09-2007, 09:55 AM
Senior Member
 
Join Date: Oct 2006
Posts: 104
antone is on a distinguished road
is this correct mr pips? will it work with strategy tester cause it is not working in the tester.. or should i only forward test it?

if (LastTradeOpenToday()) return ();

Quote:
bool LastTradeOpenToday()
{
int cnt, total;
bool Opened;


total = HistoryTotal();
for (cnt = total - 1; cnt >= 0; cnt--)
{
OrderSelect (cnt, SELECT_BY_POS, MODE_TRADES);

if(OrderSymbol()!=Symbol()) continue;
if (OrderMagicNumber() != Magic_Number) continue;

Opened = false;
if (OrderType() == OP_BUY)
{
if (TimeDay(OrderOpenTime()) >= TimeDay(TimeCurrent()))
{
Opened = true;
}
cnt = 0;
}
if (OrderType() == OP_SELL)
{
if (TimeDay(OrderOpenTime()) >= TimeDay(TimeCurrent()))
{
Opened = true;
}
cnt = 0;
}

}

return (Opened);
}

Last edited by antone; 11-09-2007 at 10:18 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #478 (permalink)  
Old 11-11-2007, 06:42 AM
etrade's Avatar
Senior Member
 
Join Date: Aug 2007
Posts: 266
etrade is on a distinguished road
Question Mathematical differential

Can a coder tell me how can I introduce a new indicator based on mathematical differential or integral ?

I am seeking for the formula which transfer an indicator to mathematical differential or integral
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #479 (permalink)  
Old 11-11-2007, 12:49 PM
Junior Member
 
Join Date: Dec 2006
Posts: 2
arasharaz is on a distinguished road
csv files

dear friends
i need an indicator to save me the CSV files instead of using "ctrl+s"
thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #480 (permalink)  
Old 11-13-2007, 02:54 PM
Junior Member
 
Join Date: Apr 2006
Posts: 2
c14n6 is on a distinguished road
need coding: when GAP occurs..

Hello everyone,

Could someone give me the code to prevent EA opening new trades when there is a gap on 1H chart? cause i want to run this ea 24 hours. Please help me ... my EA almost finish. thank you

Last edited by c14n6; 11-13-2007 at 03:01 PM. Reason: edit
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 08:56 AM.



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