• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 8:52pm
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 8:52pm
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Difference between buy/sell stops & buy/sell limits 34 replies

how to change buy to sell, sell to buy for EA 1 reply

I search script - buy limit and buy sell ! pending orders... 0 replies

the buy/buy or sell/sell currency broker?? 5 replies

I am looking for EA to put Buy Stops, Buy limits, Sell limits, and Sell Stops. I will 0 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 6
Attachments: Buy/Sell Script
Exit Attachments

Buy/Sell Script

  • Post #1
  • Quote
  • First Post: Feb 5, 2010 8:02am Feb 5, 2010 8:02am
  •  usdivers
  • | Joined Sep 2007 | Status: Member | 245 Posts
Does anyone have a script for metatrader that when you are buying or selling, you can automatically put your profit target in.

IE...what I am looking for is that when I go long or short, the profit target of 5 pips (or whatever I put in) is automatically set.

Anyone ever hear of such a thing?
  • Post #2
  • Quote
  • Feb 5, 2010 8:12am Feb 5, 2010 8:12am
  •  Pipo
  • | Joined Aug 2006 | Status: Member | 384 Posts
here you go
it's hard coded to 1 lot at 5 pips profit and 20 stoploss. Just open it up with the editor and make the changes to suit you. If you use 5 digit broker 5 pips is then 50 and 20 is 200.
Just another tip as speed is of essence make yourself a hotkey for buy and one for sell you will be lot quicker to collect those pips
Attached Files
File Type: mq4 Buy.mq4   < 1 KB | 4,143 downloads
File Type: mq4 Sell.mq4   < 1 KB | 3,498 downloads
 
1
  • Post #3
  • Quote
  • Feb 5, 2010 8:16am Feb 5, 2010 8:16am
  •  usdivers
  • | Joined Sep 2007 | Status: Member | 245 Posts
Quoting Pipo
Disliked
here you go
it's hard coded to 1 lot at 5 pips profit and 20 stoploss. Just open it up with the editor and make the changes to suit you. If you use 5 digit broker 5 pips is then 50 and 20 is 200.
Ignored
Thanks...I will try em
 
 
  • Post #4
  • Quote
  • Feb 5, 2010 12:17pm Feb 5, 2010 12:17pm
  •  forexsaint
  • Joined Jun 2009 | Status: <-That's how u gonna b, in the END! | 1,508 Posts
A wide variety of related scripts have been posted --> HERE <--
Esp. Script No.1 , 2 & 3
Hope this helps.
100 Fold Challenge->Interested? ->https://www.forexfactory.com/thread/32152
 
 
  • Post #5
  • Quote
  • Feb 25, 2010 10:58am Feb 25, 2010 10:58am
  •  rapidfx
  • | Joined Nov 2006 | Status: Member | 58 Posts
Quoting Pipo
Disliked
here you go
it's hard coded to 1 lot at 5 pips profit and 20 stoploss. Just open it up with the editor and make the changes to suit you. If you use 5 digit broker 5 pips is then 50 and 20 is 200.
Just another tip as speed is of essence make yourself a hotkey for buy and one for sell you will be lot quicker to collect those pips
Ignored
could we add how many position we want to open..like 50 post..so..when enter this script we can input how many post we want to open at one time..instead of drag 50 times to chart..
 
 
  • Post #6
  • Quote
  • Edited at 5:06am Mar 1, 2010 4:40am | Edited at 5:06am
  •  Pipo
  • | Joined Aug 2006 | Status: Member | 384 Posts
rapidFx, open script with editor and change

double lots = 1.00;
to
#property show_inputs
extern double lots;

compile and you are done.

if you wonna input stoploss and takeprofit then make changes from

double stopsize = 50;
double profsize = 20;
to
extern double stopsize;
extern double profsize;

Anyway for scalping you have the input numbers already in the script you'll be alot quicker
 
 
  • Post #7
  • Quote
  • Mar 1, 2010 9:31pm Mar 1, 2010 9:31pm
  •  rapidfx
  • | Joined Nov 2006 | Status: Member | 58 Posts
Quoting Pipo
Disliked
rapidFx, open script with editor and change

double lots = 1.00;
to
#property show_inputs
extern double lots;

compile and you are done.

if you wonna input stoploss and takeprofit then make changes from

double stopsize = 50;
double profsize = 20;
to
extern double stopsize;
extern double profsize;

Anyway for scalping you have the input numbers already in the script you'll be alot quicker
Ignored
pipo,
what i means is post trade..not lot..let say i want to buy 1 lot gu with tp & sl and i want to open 10 post..so when i drag the script i will open 10 open order with every post 1 lot..hope you could help...thank you.
 
 
  • Post #8
  • Quote
  • Mar 1, 2010 11:35pm Mar 1, 2010 11:35pm
  •  profi4554
  • | Joined Feb 2008 | Status: Member | 151 Posts
Quoting rapidfx
Disliked
pipo,
what i means is post trade..not lot..let say i want to buy 1 lot gu with tp & sl and i want to open 10 post..so when i drag the script i will open 10 open order with every post 1 lot..hope you could help...thank you.
Ignored
Hi rapidfx,

I wish the script attached could help you achieve what you have been looking for.

Simply adjust the parameter inside the script to your likings.
The defaults are as below;

double Lots = 0.1;
int NumOfOrders = 5; // number of orders to open. Make sure it is not more than the arrays for take profit and stop loss
int OrdersTP[5] = {10, 10, 15, 20, 30}; // take profit values for the orders
int OrdersSL[5] = {50, 50, 50, 50, 50}; // stop loss per order
int NumOfAttemptsPerOrder = 2;



Cheers,
~profi~
Attached Files
File Type: mq4 Multiorder_Buy.mq4   2 KB | 2,286 downloads
File Type: mq4 Multiorder_Sell.mq4   2 KB | 2,007 downloads
~ Let the TRADES come to you - be a TRAPPER not a HUNTER ~
 
1
  • Post #9
  • Quote
  • Mar 7, 2010 12:14am Mar 7, 2010 12:14am
  •  rapidfx
  • | Joined Nov 2006 | Status: Member | 58 Posts
Quoting profi4554
Disliked
Hi rapidfx,

I wish the script attached could help you achieve what you have been looking for.

Simply adjust the parameter inside the script to your likings.
The defaults are as below;

double Lots = 0.1;
int NumOfOrders = 5; // number of orders to open. Make sure it is not more than the arrays for take profit and stop loss
int OrdersTP[5] = {10, 10, 15, 20, 30}; // take profit values for the orders
int OrdersSL[5] = {50, 50, 50, 50, 50}; // stop loss per order
int NumOfAttemptsPerOrder = 2;



Cheers,
~profi~
Ignored
Hi profi,
I just tried to attached on the chart but not function...even window box does not appear. Could u check again..
 
 
  • Post #10
  • Quote
  • Edited at 5:51am Mar 7, 2010 4:59am | Edited at 5:51am
  •  profi4554
  • | Joined Feb 2008 | Status: Member | 151 Posts
Quoting rapidfx
Disliked
Hi profi,
I just tried to attached on the chart but not function...even window box does not appear. Could u check again..
Ignored
Hi rapidfx,

You have to edit the script parameter to suits your requirement from Metaeditor.

Window box will not appear as the parameter are not set as "extern". This is a script and we would like it to execute immediately once being called (using HotKey) or drag&drop on a chart.

Here an example how to edit the script based on your earlier requirement ;

double Lots = 1.0;
int NumOfOrders = 10; // number of orders to open. Make sure it is not more than the arrays for take profit and stop loss
int OrdersTP[10] = {10, 10, 10, 10, 10, 10, 10, 10, 10, 10}; // take profit values for the orders
int OrdersSL[10] = {20, 20, 20, 20, 20, 20, 20, 20, 20, 20}; // stop loss per order
int NumOfAttemptsPerOrder = 2;


Please make sure you already tick (Allow Live Trading) box from Expert Adivsors Tab under Tools --> Options.

Hope this will help you

Cheers,
~profi~
~ Let the TRADES come to you - be a TRAPPER not a HUNTER ~
 
1
  • Post #11
  • Quote
  • Apr 22, 2012 12:09am Apr 22, 2012 12:09am
  •  zabidin2
  • | Joined Apr 2012 | Status: Member | 29 Posts
Is this script or EA?
 
 
  • Post #12
  • Quote
  • Apr 22, 2012 1:20am Apr 22, 2012 1:20am
  •  CandleForex
  • | Commercial Member | Joined Feb 2011 | 41 Posts
It is a script.

An EA generally trades automatically, a script just does a function based on user input.

There are exceptions though.


Quoting zabidin2
Disliked
Is this script or EA?
Ignored
 
 
  • Post #13
  • Quote
  • Apr 24, 2012 5:27am Apr 24, 2012 5:27am
  •  zabidin2
  • | Joined Apr 2012 | Status: Member | 29 Posts
Have you try this script?? Is it working??
 
 
  • Post #14
  • Quote
  • May 9, 2012 12:41am May 9, 2012 12:41am
  •  sherifmao
  • | Joined Aug 2009 | Status: Junior Member | 1 Post
i need script with manager risk .... please if you can help i will be thank you
 
 
  • Post #15
  • Quote
  • Apr 3, 2013 12:50pm Apr 3, 2013 12:50pm
  •  Mummyz
  • | Joined Jul 2011 | Status: FX-Syndicate | 18 Posts
Hii profi4554,

Can you help me if I want a script with below conditions..

------------------------------------------------------------------------------------
Multiple Pending Buy Script
------------------------------------------------------------------------------------
- Parameter : Open Buy Stop with Hard Coded Price (Ex. 1.2840)
- Parameter : Level (Ex. 10)
- Parameter : Increment (Ex. 20)
------------------------------------------------------------------------------------

------------------------------------------------------------------------------------
Multiple Pending Sell Script
------------------------------------------------------------------------------------
- Parameter : Open Sell Stop with Hard Coded Price (Ex. 1.2820)
- Parameter : Level (Ex. 10)
- Parameter : Increment (Ex. 20)
------------------------------------------------------------------------------------

So the Script will automatically Open Next Buy Stop and Sell Stop for every 20 pips until 10 Levels..
Many Thanks Before..
Trade Safely with FX-Syndicate
 
 
  • Post #16
  • Quote
  • Jul 29, 2017 1:11am Jul 29, 2017 1:11am
  •  Zfs
  • | Joined Jan 2016 | Status: Junior Member | 1 Post
is there any who have the script for Buy/Sell only. without other thing. for example, when I press control b for buy and control s for sell. That's all I need. Thanks
 
 
  • Post #17
  • Quote
  • Oct 31, 2019 2:26pm Oct 31, 2019 2:26pm
  •  gmutota
  • | Joined Sep 2019 | Status: Junior Member | 1 Post
Anyone that know of a script that opn buy and stop orders at specified time. For example if I want to open a buy stop at 14:30 it will automatically open at that specific time.
 
 
  • Post #18
  • Quote
  • Dec 2, 2021 10:55pm Dec 2, 2021 10:55pm
  •  shyean
  • | Joined Apr 2016 | Status: Member | 430 Posts
Hello danzka,

You can try below scripts. I have edited to include SL and TP when sending orders instead of modifying after. Just open the source code to edit the values.

Thanks
Attached File
File Type: mq4 Buy Script.mq4   1 KB | 151 downloads
Attached File
File Type: mq4 Sell Script.mq4   1 KB | 120 downloads

Quoting danzka
Disliked
{quote} found some in here https://www.forexfactory.com/thread/...buysell-script works fine in non Lux account, but in Lux it seems that the script put order first then modify the TP SL later I tried mess around with the code to send the order along with the TP SL but I can't get it to work oh well time to look for another prop
Ignored
"The markets can remain irrational longer than you can remain solvent."
 
 
  • Post #19
  • Quote
  • Last Post: Dec 3, 2021 3:32am Dec 3, 2021 3:32am
  •  danzka
  • | Joined May 2011 | Status: Member | 586 Posts
Quoting shyean
Disliked
Hello danzka, You can try below scripts. I have edited to include SL and TP when sending orders instead of modifying after. Just open the source code to edit the values. Thanks {file}{file} {quote}
Ignored
oh wow that works, thank you so much man
btw I deleted the #property show_inputs so that it enter without confirmation
may your pips be many
In the end its just a stupid numbers game
 
1
  • Platform Tech
  • /
  • Buy/Sell Script
  • Reply to Thread
0 traders viewing now
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2022