Forex



Go Back   Forex Trading > Downloads > Expert Advisors - 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 10-17-2006, 08:26 AM
Junior Member
 
Join Date: Nov 2005
Location: Brisbane, Oz
Posts: 4
Rastarr is on a distinguished road
script to place market order with TP and SL set

Hi guys,

I was wondering whether someone might quickly code up a script that will allow me to place a market order with a defined stop loss and take profit. I've included a feeble attempt below which doesn't seem to be working.

Any help would be fantastic
Martin

Code:
//+------------------------------------------------------------------+
//| Buy.mq4 |
//+------------------------------------------------------------------+
#property copyright ""
#property link ""
#include <stdlib.mqh>
#include <WinUser32.mqh>

double Lots=0.1;
int Slippage=3;
int TakeProfit=99;
int StopLoss=10;
//+------------------------------------------------------------------+
//| script program start function |
//+------------------------------------------------------------------+
int start()
{
double MyStopLoss=Ask-StopLoss*Point;
double MyTakeProfit=Ask+TakeProfit*Point;

//----
OrderPrint();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,MyStopLoss,MyTakeProfit,"Buy",0,0,CLR_NONE);
return(0);
}
//+------------------------------------------------------------------+
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 10-26-2006, 05:22 AM
Aaragorn's Avatar
Senior Member
 
Join Date: Jun 2006
Location: USA
Posts: 801
Aaragorn is on a distinguished road
I'm workin on it...

http://www.forex-tsd.com/58324-post1024.html
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
A script to read the account history and place trade arrows? Lyubomir General Discussion 3 08-17-2009 10:03 AM
EA or Script for pending order ? Nordic12 Tools and utilities 6 10-08-2007 07:35 PM
Need Order script w/ built in SL wadeboxjr Metatrader 4 1 03-06-2007 02:39 PM
How to place more than one order simultaneously? thiagomartini Questions 0 05-26-2006 05:08 PM
Place order with no takeprofit cardio Setup Questions 2 01-30-2006 06:32 PM


All times are GMT. The time now is 07:44 PM.



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