Forex
Google

Go Back   Forex Trading > Programming > Metatrader Programming
Forex Forum FAQ Members List Calendar 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

 
 
LinkBack Thread Tools
 
Old 09-03-2007, 12:59 AM
icm63 icm63 is offline
Member
 
Join Date: Feb 2006
Posts: 52
icm63 is on a distinguished road
Avoid MT4 Broker Stop hunting with market orders only

When an order is placed with a stop order and a take profit order we are placing a stop loss order as an order type of 'ON STOP', and the take profit order is a 'LIMIT' order.

As LIMIT and STOP orders can been seen by the broker, the broker can push price up to take out your orders for there own quick gain. This is called stop hunting. I do not wish to discuss stop hunting here on the thread. Its been fully discussed here : STOP HUNTING: Hardcore Proof that your broker may be cheating on you

A way to beat the brokers is to place market orders only. So price is monitored within the EA and a market order is sent once desired price is hit. So market orders are used to enter market and exit market, and the EA monitors prices levels, not the MT4 open orders table.

QUESTION: Has any one or are there any examples of MT4 code doing this anywhere ?? Please advise....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 09-03-2007, 02:35 AM
prasxz prasxz is offline
Senior Member
 
Join Date: Jun 2006
Posts: 1,043
prasxz is on a distinguished road
hi

Quote:
Originally Posted by icm63 View Post
When an order is placed with a stop order and a take profit order we are placing a stop loss order as an order type of 'ON STOP', and the take profit order is a 'LIMIT' order.

As LIMIT and STOP orders can been seen by the broker, the broker can push price up to take out your orders for there own quick gain. This is called stop hunting. I do not wish to discuss stop hunting here on the thread. Its been fully discussed here : STOP HUNTING: Hardcore Proof that your broker may be cheating on you

A way to beat the brokers is to place market orders only. So price is monitored within the EA and a market order is sent once desired price is hit. So market orders are used to enter market and exit market, and the EA monitors prices levels, not the MT4 open orders table.

QUESTION: Has any one or are there any examples of MT4 code doing this anywhere ?? Please advise....

did u mean place limit and stop ...with set of TP and SL ?
if yes, you can place your order using pending order built in MT4

===================
Forex Indicators Collection
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 09-03-2007, 05:38 AM
FerruFx FerruFx is offline
Senior Member
 
Join Date: Feb 2007
Posts: 589
FerruFx is on a distinguished road
Quote:
Originally Posted by icm63 View Post
QUESTION: Has any one or are there any examples of MT4 code doing this anywhere ?? Please advise....

Code:
if(TakeProfit != 0)
{
 if(CountLongs() != 0)
 {
  if(Bid >= OrderOpenPrice()+TakeProfit*Point) CloseLongs();
 }
 if(CountShorts() != 0)
 {
  if(Ask <= OrderOpenPrice()-TakeProfit*Point) CloseShorts();
 }
}
Keep in mind that this solution work ONLY if your platform is connected.

FerruFx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 09-06-2007, 12:35 AM
MrPip MrPip is offline
Senior Member
 
Join Date: Mar 2006
Location: La Verne,CA
Posts: 551
MrPip is on a distinguished road
Quote:
Originally Posted by FerruFx View Post
Code:
if(TakeProfit != 0)
{
 if(CountLongs() != 0)
 {
  if(Bid >= OrderOpenPrice()+TakeProfit*Point) CloseLongs();
 }
 if(CountShorts() != 0)
 {
  if(Ask <= OrderOpenPrice()-TakeProfit*Point) CloseShorts();
 }
}
Keep in mind that this solution work ONLY if your platform is connected.

FerruFx
I use a SafetyStopLossMultiplier and SafetyTakeProfitMultiplier to send the broker a value that is larger then the SL and TP I actually use in my EAs. This acts as insurance in case of disconnect.

Robert
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 09-06-2007, 12:55 AM
FerruFx FerruFx is offline
Senior Member
 
Join Date: Feb 2007
Posts: 589
FerruFx is on a distinguished road
Quote:
Originally Posted by MrPip View Post
I use a SafetyStopLossMultiplier and SafetyTakeProfitMultiplier to send the broker a value that is larger then the SL and TP I actually use in my EAs. This acts as insurance in case of disconnect.
Robert,

I missed something: you send to your broker a value, say 100, and your EA stop at, say 80. Like this the broker can't see your real stop and can't hunt it. Right?

If your are disconnected, who send the order to close at 80? I don't understand your method.

Thanks for your explanation.

FerruFx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 09-06-2007, 12:58 AM
MrPip MrPip is offline
Senior Member
 
Join Date: Mar 2006
Location: La Verne,CA
Posts: 551
MrPip is on a distinguished road
Quote:
Originally Posted by FerruFx View Post
Robert,

I missed something: you send to your broker a value, say 100, and your EA stop at, say 80. Like this the broker can't see your real stop and can't hunt it. Right?

If your are disconnected, who send the order to close at 80? I don't understand your method.

Thanks for your explanation.

FerruFx
If you get disconnected the trade will close at 100. The same for the takeprofit side. As I mentioned this is for insurance. If you get disconnected it is possible when you reconnect you could be down 200.

Robert
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 09-06-2007, 01:06 AM
FerruFx FerruFx is offline
Senior Member
 
Join Date: Feb 2007
Posts: 589
FerruFx is on a distinguished road
Quote:
Originally Posted by MrPip View Post
If you get disconnected the trade will close at 100. The same for the takeprofit side. As I mentioned this is for insurance. If you get disconnected it is possible when you reconnect you could be down 200.

Robert
Ok i understand. Just a security.

Thanks Robert.

FerruFx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 

Thread Tools

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
mt4 broker closed my orders?? jackjones General Discussion 2 05-23-2007 02:32 PM
Lot sum after EA test / Avoid "CLOSE AT STOP" budhax Expert Advisors - Metatrader 4 4 02-16-2007 03:16 AM
Two orders and trailing stop Toccata Metatrader 4 2 12-22-2006 01:54 PM
Trailing Stop EA for PENDING orders rjay Expert Advisors - Metatrader 4 1 12-05-2006 12:22 PM
Are stop orders necessary in EA? GP2X General Discussion 6 09-12-2006 06:22 PM


All times are GMT. The time now is 08:26 AM.