Forex



Go Back   Forex Trading > Discussion Areas > Metatrader 4
Forex Forum Register More recent Blogs 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 02-01-2006, 03:06 PM
Junior Member
 
Join Date: Nov 2005
Posts: 26
caldolegare is an unknown quantity at this point
Stop Loss/Take Profit problem

Ok I have a problem. When I set up by open like this it works.

ticket1=OrderSend(Symbol(),OP_SELL,1.0,Bid,0,0,0," expert comment",255,0,CLR_NONE);

But when I put in my stop loss and my take profit it doesn't. I've tried the 3 following variations but to no avail.

ticket1=OrderSend(Symbol(),OP_SELL,1.0,Bid,0,20,30 ,"expert comment",255,0,CLR_NONE);

ticket1=OrderSend(Symbol(),OP_SELL,1.0,Bid,0,100,1 00,"expert comment",255,0,CLR_NONE);

ticket1=OrderSend(Symbol(),OP_SELL,1.0,Bid,0,stopL oss,takeProfit,"expert comment",255,0,CLR_NONE);
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 02-01-2006, 03:21 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 994
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Arrow Point

Quote:
Originally Posted by caldolegare
Ok I have a problem. When I set up by open like this it works.

ticket1=OrderSend(Symbol(),OP_SELL,1.0,Bid,0,0,0," expert comment",255,0,CLR_NONE);

But when I put in my stop loss and my take profit it doesn't. I've tried the 3 following variations but to no avail.

ticket1=OrderSend(Symbol(),OP_SELL,1.0,Bid,0,20,30 ,"expert comment",255,0,CLR_NONE);

ticket1=OrderSend(Symbol(),OP_SELL,1.0,Bid,0,100,1 00,"expert comment",255,0,CLR_NONE);

ticket1=OrderSend(Symbol(),OP_SELL,1.0,Bid,0,stopL oss,takeProfit,"expert comment",255,0,CLR_NONE);
caldolegare,

Try this:

ticket1=OrderSend(Symbol(),OP_SELL,1.0,Bid,0,Bid+20*Point,Bid-30*Point,"expert comment",255,0,CLR_NONE);

Note: Pointfunction returns the point size of the current currency symbol.
For example: if you trade EURUSD the point value = .0001 and if you trade EURJPY the point value should be .01
So, you have to convert your stoploss and takeprofit values to points before using them with OrderSend or OrderModify functions.
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
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 02-12-2007, 06:16 PM
Junior Member
 
Join Date: Feb 2007
Posts: 1
gestibar is on a distinguished road
Post tnx

nice
)
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 02-15-2007, 01:43 PM
accrete's Avatar
Member
 
Join Date: Jan 2006
Location: The WET! Coast of Oregon, USA
Posts: 69
accrete is on a distinguished road
Question

i'm placing this question here as i didn't want to start a new thread...

I've tried every thing i could (read the help file, look online...) and i'm still stumped. . .

Say i'm long on the GbpUsd at 1.9000 with 60 lots and i wish to take 20 partial lots in profit at 1.9050, another 20 lots in profit at 1.9100 and let the final 20 lots ride with a 50 pip trailing stop.

I've tried everything that is listed in the HELP menu under "Take Profit" and all i get is new Sell Limit orders for 20 lots executed at the levels set and still have the original 60 lots still running.

I've never really addressed this issue in MT4 as i've always traded in my FXSol account without any issues in this area... how is this pulled off in MT4?? It is not apparently by the HELP instructions that i'm reading and implementing.

THANK YOU IN ADVANCE... yes i was yelling that from the rooftop!

Cheers,
Thom
__________________
Find a way to make someone's day
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 02-17-2007, 06:27 AM
Member
 
Join Date: Jun 2006
Posts: 56
timbobo is on a distinguished road
Quote:
Originally Posted by accrete
Say i'm long on the GbpUsd at 1.9000 with 60 lots and i wish to take 20 partial lots in profit at 1.9050, another 20 lots in profit at 1.9100 and let the final 20 lots ride with a 50 pip trailing stop.
I don't think it's possible. MT works with Order, you can open it, modify or delete but the full order. The only way to split existing order is command OrderCloseBy. So, if you are long with 60 lots and want to close 20 lots, you should open one more order - short with 20 lots and after that use OrderCloseBy(ticket_long, ticket_short). As result you will stay with one order long with 40 lots only. You can use that command in EA or in script if you trade manually.
Some brokers may not support that command.
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
Employ Someone and profit from Loss tony hadley General Discussion 14 06-20-2009 05:37 PM
Problem Opening Sell Trades With Stop Loss sbwent Metatrader 4 2 03-12-2007 12:44 AM
Profit/Loss - 221/3 Oligarh Expert Advisors - Metatrader 4 81 12-05-2006 10:44 AM
How do I set default Stop Loss / Take Profit astro Questions 8 06-14-2006 12:55 AM


All times are GMT. The time now is 03:31 AM.



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