Forex



Go Back   Forex Trading > Programming > MetaTrader
Forex Forum Register More recent Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 09-03-2007, 01:59 AM
Member
 
Join Date: Feb 2006
Posts: 63
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #2 (permalink)  
Old 09-03-2007, 03:35 AM
Senior Member
 
Join Date: Jun 2006
Posts: 1,513
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #3 (permalink)  
Old 09-03-2007, 06:38 AM
Senior Member
 
Join Date: Feb 2007
Posts: 986
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #4 (permalink)  
Old 09-06-2007, 01:35 AM
Senior Member
 
Join Date: Mar 2006
Location: La Verne,CA
Posts: 560
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #5 (permalink)  
Old 09-06-2007, 01:55 AM
Senior Member
 
Join Date: Feb 2007
Posts: 986
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #6 (permalink)  
Old 09-06-2007, 01:58 AM
Senior Member
 
Join Date: Mar 2006
Location: La Verne,CA
Posts: 560
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #7 (permalink)  
Old 09-06-2007, 02:06 AM
Senior Member
 
Join Date: Feb 2007
Posts: 986
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
mt4 broker closed my orders?? jackjones General Discussion 2 05-23-2007 03:32 PM
Lot sum after EA test / Avoid "CLOSE AT STOP" budhax Expert Advisors - Metatrader 4 4 02-16-2007 04:16 AM
Two orders and trailing stop Toccata Metatrader 4 2 12-22-2006 02:54 PM
Trailing Stop EA for PENDING orders rjay Expert Advisors - Metatrader 4 1 12-05-2006 01:22 PM
Are stop orders necessary in EA? GP2X General Discussion 6 09-12-2006 07:22 PM


All times are GMT. The time now is 07:58 AM.



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